#include<bits/stdc++.h> #define ll long long #define ld long double #define int long long #define N 50 #define Orz ios::sync_with_stdio(0),cin.tie(0) #define INF 2e18 #define rep(i,l,r) for(int i=l;i<=r;i++) #define all(x) x.begin(),x.end() #define pii pair<int,int> #define x first #define y second usingnamespace std; int n; bool a[N],b[N],f = 1;