// yukicoder: No.208 王将 // 2019.6.24 bal4u #include int main() { int x, y, x2, y2, ans; scanf("%d%d%d%d", &x, &y, &x2, &y2); if (x == y) { if (x2 == y2 && x2 < x) ans = x + 1; else ans = x; } else if (x < y) ans = y; else ans = x; printf("%d\n", ans); return 0; }