#include <iostream> 
#include <math.h>
#include <time.h>
using namespace std;
void main (){
	setlocale(LC_ALL,"rus");
 int H,M,S;
cout<<"введите колличество часо,минут, секунд\n";
cin>>H>>M>>S;
if(S+1<60)
cout<<H<<M<<S+1;
else {
if(M+1<60)
cout<<H<<M+1<<"00\n";
else
{
if(H+1<24)
cout<<H+1<<"00"<<"\n"<<endl;
else 
cout<<"00"<<"00"<<"00\n";
}
}
}