#pragma GCC target("avx2") #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #include #include #define B_SIZE 256 #define C_SIZE 2048 using namespace std; long long start_time; void start_clock(){ struct timeval tv; gettimeofday(&tv, NULL); start_time=(tv.tv_sec*1000000+tv.tv_usec); } long long current_clock(){ struct timeval tv; gettimeofday(&tv, NULL); long long current_time=(tv.tv_sec*1000000+tv.tv_usec); return (current_time-start_time); //cout << current_time-start_time << "(us)\n"; } uint32_t xor64(void){ static uint64_t x = 88172645463325252ULL; x = x ^ (x << 13); x = x ^ (x >> 7); return x = x ^ (x << 17); } int a[C_SIZE][3]; char p[C_SIZE][3]; int mxm=-1; string res,cs; set unsat; int sat_cnt[C_SIZE]={0}; using pi=pair; vector> g; int main(){ start_clock(); ios::sync_with_stdio(false); cin.tie(nullptr); g.resize(B_SIZE); for(int i=0;i> a[i][0] >> a[i][1] >> a[i][2]; int pp,qq,rr; cin >> pp >> qq >> rr; p[i][0]=(pp+'0'); p[i][1]=(qq+'0'); p[i][2]=(rr+'0'); g[a[i][0]].push_back({i,0}); g[a[i][1]].push_back({i,1}); g[a[i][2]].push_back({i,2}); if(pp==0){sat_cnt[i]++;} if(qq==0){sat_cnt[i]++;} if(rr==0){sat_cnt[i]++;} if(sat_cnt[i]==0){unsat.insert(i);} } for(int i=0;i=1990000){break;} i=0; } } //cout << mxm << '\n'; reverse(res.begin(),res.end()); cout << res << '\n'; return 0; }