#include #include #include #include #include #include #include #include #include #include #include using namespace std; int i,j,n,m; int v[10001]; int a,b,c,d; string s; int main(){ cin>>n; for(i=1; i<=n; i++) { bool ok = true; cin>>s; a=s[0]-'0'; b=s[1]-'0'; c=s[3]-'0'; d=s[4]-'0'; int xx = a; xx = xx*10 + b; int yy = c; yy = yy*10 + d; if ( xx > 24 or yy >= 60 and ok == true ) { ok = false; cout<<"NO"<