#include #include using namespace std; int main(void){ int x, y, hx, hy; cin >> x >> y >> hx >> hy; int a = max(x, y); if (x != y){ cout << a << endl; return 0; } cout << ((hx < x && hx == hy) ? x + 1 : x) << endl; return 0; }