#include #include #include #include ///////// #define REP(i, x, n) for(int i = x; i < n; i++) #define rep(i,n) REP(i,0,n) #define P(p) cout<<(p)<> N; int f[10]; rep(i,10)f[i] = 1; int a,b,c,d; string str; rep(i,N){ cin>>a>>b>>c>>d>>str; if(str == "YES"){ rep(k,10){ if( k != a && k != b && k != c && k != d){ f[k] = 0; } } }else{//"NO" f[a]=0; f[b]=0; f[c]=0; f[d]=0; } } rep(i,10){ if(f[i]>0){ P(i); } } return 0; }