#include <iostream>
#include <vector>
//#include <stdexcept>
typedef std::pair<int, int> SepT;
SepT SeparateDigit(int N){
//if (N > 60) throw std::out_of_range("value is out of range");//choice best exception by you
int A = N - (N / 10) * 10;
int B = (N - A)/10;
std::swap(A , B);
return std::make_pair(A, B);
}
bool IsZorome(SepT S, bool IsZeroValid = false){
if (S.first == S.second) return true;
if (S.first == 0 && IsZeroValid == true) return true;
return false;
}
int main(){
SepT A;
SepT B;
bool F1 = false;
bool F2 = false;
for (int i = 0; i < 24; i++){
for (int j = 0; j < 60; j++){
A = SeparateDigit(i);
B = SeparateDigit(j);
F1 = IsZorome(A, true);
F2 = IsZorome(B);
if (((F1&&F2) == true)&& (A.second == B.second)) std::cout << (A.first ? A.first : 0) << A.second << ':' << B.first << B.second<<std::endl;
}
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgovLyNpbmNsdWRlIDxzdGRleGNlcHQ+CnR5cGVkZWYgc3RkOjpwYWlyPGludCwgaW50PiBTZXBUOwoKU2VwVCBTZXBhcmF0ZURpZ2l0KGludCBOKXsKCS8vaWYgKE4gPiA2MCkgdGhyb3cgc3RkOjpvdXRfb2ZfcmFuZ2UoInZhbHVlIGlzIG91dCBvZiByYW5nZSIpOy8vY2hvaWNlIGJlc3QgZXhjZXB0aW9uIGJ5IHlvdQoJaW50IEEgPSBOIC0gKE4gLyAxMCkgKiAxMDsKCWludCBCID0gKE4gLSBBKS8xMDsKCXN0ZDo6c3dhcChBICwgQik7CglyZXR1cm4gc3RkOjptYWtlX3BhaXIoQSwgQik7Cn0KCmJvb2wgSXNab3JvbWUoU2VwVCBTLCBib29sIElzWmVyb1ZhbGlkID0gZmFsc2UpewoKCWlmIChTLmZpcnN0ID09IFMuc2Vjb25kKSByZXR1cm4gdHJ1ZTsKCWlmIChTLmZpcnN0ID09IDAgJiYgSXNaZXJvVmFsaWQgPT0gdHJ1ZSkgcmV0dXJuIHRydWU7CgoJcmV0dXJuIG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