Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x = list(map(int,input().split()))
- y = list(map(int,input().split()))
- n = 0
- while True:
- if (x[0] > y[0] or (x[0] == 0 and y[0] == 9)) and (x[0] != 9 and y[0] != 0):
- x.append(x[0])
- x.append(y[0])
- else:
- y.append(x[0])
- y.append(y[0])
- x.remove(x[0])
- y.remove(y[0])
- n+=1
- if (len(x) == 0):
- print("second"+" "+str(n))
- break
- if (len(y) == 0):
- print("first"+" "+str(n))
- break
- if (n > 1000000):
- print("botva")
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement