Advertisement
PikMike

Untitled

Mar 18th, 2016
359
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. def read(s, t):
  2.     if (s[0] == 'X'):
  3.         return s[1] + t[::-1]
  4.     if (s[1] == 'X'):
  5.         return t[::-1] + s[0]
  6.     if (t[0] == 'X'):
  7.         return t[1] + s
  8.     if (t[1] == 'X'):
  9.         return s + t[0]
  10.  
  11. s1 = ''.join(input().split())
  12. s2 = ''.join(input().split())
  13. t1 = ''.join(input().split())
  14. t2 = ''.join(input().split())
  15. s = read(s1, s2)
  16. t = read(t1, t2)
  17. for i in range(3):
  18.     for j in range(3):
  19.         #print(s[i:] + s[:i], t[j:] + t[:j])
  20.         if s[i:] + s[:i] == t[j:] + t[:j]:
  21.             print("YES")
  22.             exit(0)
  23. print("NO")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement