#include <iostream>
#define _USE_MATH_DEFINES
#include <math.h>
bool IsEqual(double A, double B, double G){
return ((A + G >= B)&&( A - G <= B)) ? true : false;
}
int main(){
double SM = 360.0 / 60;
double LM = 360.0 / 12;
double Gosa = 1;
bool F = false;
double LT = 0;
double MT = 0;
for (int H = 0; H < 12; H++){
F = false;
for (int M = 0; M < 60; M++){
for (int S = 0; S < 60; S++){
LT = LM*H + (SM / 60.0)*M + ((SM / 360.0)*(S*6.0)) / 60.0;
MT = SM*M + (SM / 60.0)*S;
if (IsEqual(LT, MT,Gosa/2) == true){
std::cout << floor(12*LT/360.0) << ':' << floor(60*MT/360.0) <<':'<<S<< std::endl;
F = true;
}
if (F == true) break;
}
if (F == true) break;
}
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojZGVmaW5lIF9VU0VfTUFUSF9ERUZJTkVTCiNpbmNsdWRlIDxtYXRoLmg+Cgpib29sIElzRXF1YWwoZG91YmxlIEEsIGRvdWJsZSBCLCBkb3VibGUgRyl7CglyZXR1cm4gKChBICsgRyA+PSBCKSYmKCBBIC0gRyA8PSBCKSkgPyB0cnVlIDogZmFsc2U7Cn0KCmludCBtYWluKCl7Cglkb3VibGUgU00gPSAzNjAuMCAvIDYwOwoJZG91YmxlIExNID0gMzYwLjAgLyAxMjsKCWRvdWJsZSBHb3NhID0gMTsKCWJvb2wgRiA9IGZhbHNlOwoJZG91YmxlIExUID0gMDsKCWRvdWJsZSBNVCA9IDA7Cglmb3IgKGludCBIID0gMDsgSCA8IDEyOyBIKyspewoJCUYgPSBmYWxzZTsKCQlmb3IgKGludCBNID0gMDsgTSA8IDYwOyBNKyspewoJCQlmb3IgKGludCBTID0gMDsgUyA8IDYwOyBTKyspewoJCQkJTFQgPSBMTSpIICsgKFNNIC8gNjAuMCkqTSArICgoU00gLyAzNjAuMCkqKFMqNi4wKSkgLyA2MC4wOwoJCQkJTVQgPSBTTSpNICsgKFNNIC8gNjAuMCkqUzsKCQkJCWlmIChJc0VxdWFsKExULCBNVCxHb3NhLzIpID09IHRydWUpewoJCQkJCXN0ZDo6Y291dCA8PCBmbG9vcigxMipMVC8zNjAuMCkgPDwgJzonIDw8IGZsb29yKDYwKk1ULzM2MC4wKSA8PCc6Jzw8Uzw8IHN0ZDo6ZW5kbDsKCQkJCQlGID0gdHJ1ZTsKCQkJCX0JCgkJCQlpZiAoRiA9PSB0cnVlKSBicmVhazsKCQkJfQoJCQlpZiAoRiA9PSB0cnVlKSBicmVhazsKCQl9CgoJfQoJcmV0dXJuIDA7Cn0=