#include using namespace std; int main(){ int ck[10]; for(int i=0;i<=9;i++){ ck[i]=1; } int N; cin>>N; int a,b,c,d; string s; for(int i=0;i>a>>b>>c>>d; cin>>s; if(s=="NO"){ ck[a]=-1; ck[b]=-1; ck[c]=-1; ck[d]=-1; continue; } for(int i=0;i<=9;i++){ if(ck[i] != -1){ ck[i]=-1; } } ck[a]=1; ck[b]=1; ck[c]=1; ck[d]=1; } for(int i=0;i<=9;i++){ if(ck[i]==1){ cout<