#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;
}