#ifndef LOCAL #include #include #else #include #endif using namespace std; using namespace atcoder; using mint=modint998244353; using mint1=modint1000000007; using std::cout; using std::cin; #define fi first #define se second #define pb(a) push_back(a) #define eb(a) emplace_back(a) #define ppf() pop_front() #define ppb() pop_back() #define mp(f,s) make_pair(f,s) #define A(a) begin(a),end(a) #define int int64_t #define uint uint64_t #define harf int32_t #define uharf uint32_t #define endl '\n' template using vc = vector; template using vv = vc>; template using pq = priority_queue; template using pqg= priority_queue,greater>; using vi = vc; using vb = vc; using pi = pair; using str = string; const str yes="Yes\n", no="No\n"; constexpr int dx[]={-1,0,0,1,-1,1,-1,1}; constexpr int dy[]={0,-1,1,0,-1,-1,1,1}; signed main(){ cin.tie(0)->sync_with_stdio(0); int a,b,c,d; cin>>a>>b>>c>>d; int D=31-a+1+b; cout<<(c<=D?1:d<=D?2:3)<