Created
October 14, 2023 11:03
-
-
Save modos/07b30e2fb0bd5f3ebc1e220fe08ec5e5 to your computer and use it in GitHub Desktop.
کاسه و نخود
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n = int(input()) | |
ans = 1 | |
for i in range(n): | |
a, b = map(int, input().split()) | |
if a == ans: | |
ans = b | |
elif b == ans: | |
ans = a | |
print(ans) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment