Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- line = input()
- letters = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H']
- if ((line[0] or line[3]) not in letters) or ((int(line[1]) or int(line[4])) not in range(1, 9)):
- print("ERROR")
- elif abs(ord(line[0]) - ord(line[3])) == 1 and abs(int(line[1]) - int(line[4])) == 2:
- print("YES")
- elif abs(ord(line[0]) - ord(line[3])) == 2 and abs(int(line[1]) - int(line[4])) == 1:
- print("YES")
- else:
- print("NO")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement