a, b = io.read("*n", "*n") a = b + 31 - a c, d = io.read("*n", "*n") if c <= a then print(1) elseif d <= a then print(2) else print(3) end