#include using namespace std; using ll=long long; #include using namespace atcoder; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); ll P,Q,Y,p,q,y; cin>>P>>Q>>Y>>p>>q>>y; for(int i=0;iP)p=1; if(q>Q)q=1; } cout<