#include #include #include using namespace std; using namespace atcoder; using mint = modint998244353; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf32 1000000001 #define Inf64 4000000000000000001 vector> s(6); int main(){ s[0] = {}; int n; cin>>n; if(n<=2){ cout<<"NO"< a(6); rep(i,6)cin>>a[i]; vector t = {0,1,2}; bool F = false; vector xx = {1,3,4,5},yy = {2,2,2,0}; do{ bool f = true; rep(i,4){ int x = xx[i]; int y = yy[i]; if(a[x]==a[y]){ cout<<"NO"<t[a[y]]){ f= false; break; } } int x = 1; int y = 0; if(t[a[x]]>t[a[y]]){ f = false; } if(!f)continue; F = true; break; } while(next_permutation(t.begin(),t.end())); if(!F)cout<<"NO"<