Advertisement
Guest User

Untitled

a guest
Nov 30th, 2015
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. x = list(map(int,input().split()))
  2. y = list(map(int,input().split()))
  3. n = 0
  4. while True:
  5. if (x[0] > y[0] or (x[0] == 0 and y[0] == 9)) and (x[0] != 9 and y[0] != 0):
  6. x.append(x[0])
  7. x.append(y[0])
  8. else:
  9. y.append(x[0])
  10. y.append(y[0])
  11. x.remove(x[0])
  12. y.remove(y[0])
  13. n+=1
  14. if (len(x) == 0):
  15. print("second"+" "+str(n))
  16. break
  17. if (len(y) == 0):
  18. print("first"+" "+str(n))
  19. break
  20. if (n > 1000000):
  21. print("botva")
  22. break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement