Attempt the question at: https://open.kattis.com/problems/spavanac
Hint:
You can split a single line input with two data separated by a space and store them into two variables by using the following code:
(x, y) = input().split()