#include #include using namespace std; int main() { int n,X,Y,Z,T,xy,zt; cin>>n; string s; for(int i=0;i>s; X = s[0] - '0'; Y = s[1] - '0'; Z = s[3] - '0'; T = s[4] - '0'; xy = X * 10 + Y; zt = Z * 10 + T; if(xy < 0 || xy >= 24 ){ cout<<"NO"<= 60){ cout<<"NO"<