// https://szkopul.edu.pl/problemset/problem/A859_vuqciUBllN7vf9w2NYL/site/?key=statement
// OIG XV (1 etap)
#include <iostream>
#include <string>
int H, M, S;
std::string sH, sM, sS;
int main() {
std::cin >> H >> M >> S;
S++;
if (S == 60) {
sS = "00";
M++;
} else if (S < 10)
sS = "0" + std::to_string(S);
else
sS = std::to_string(S);
if (M == 60) {
sM = "00";
H++;
} else if (M < 10)
sM = "0" + std::to_string(M);
else
sM = std::to_string(M);
if (H == 24)
sH = "00";
else if (H < 10)
sH = "0" + std::to_string(H);
else
sH = std::to_string(H);
std::cout << sH << ":" << sM << ":" << sS << std::endl;
}