x = int(input())
if x > 0:
    y1 = int(input())
    if y1 > 0:
        print(1)
    else:
        print(4)
else:
    y2 = int(input())
    if y2 > 0:
        print(2)
    else:
        print(3)

0e5aa24df3c189e21bca45e3eba3388e151edbde
<mask token>

<mask token>
if x > 0:
    y1 = int(input())
    if y1 > 0:
        print(1)
    else:
        print(4)
else:
    y2 = int(input())
    if y2 > 0:
        print(2)
    else:
        print(3)

x = int(input())
if x > 0:
    y1 = int(input())
    if y1 > 0:
        print(1)
    else:
        print(4)
else:
    y2 = int(input())
    if y2 > 0:
        print(2)
    else:
        print(3)
