#include <iostream>
using namespace std;
class Cmytime
{
private:
int mh, mm, ms;
public:
void Show()
{
cout<< mh << ":"
<< mm << ":"
<< ms << endl;
}
int Set(int h, int m, int s)
{
do{
if (h < 0) break;
if (h >= 24) break;
if (m < 0) break;
if (m > 60) break;
if (s < 0) break;
if (s > 60) break;
mh = h;
mm = m;
ms = s;
return 1;
} while (false);
return 0;
}
void AddOneSecond()
{
int k;
ms += 1; k = ms / 60; ms %= 60;
mm += k; k = mm / 60; mm %= 60;
mh += k; mh %= 24;
}
};
//StudybarCommentBegin
int main(void) {
int h, m, s;
cin >> h >> m >> s;
Cmytime t1;
t1.Set(h, m, s);
t1.Show();
cout << endl << t1.Set(24, 0, 0) << "\n";
t1.Show();
t1.AddOneSecond();
cout << endl;
t1.Show();
return 0;
}
//StudybarCommentEnd