Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. n, m = input().split()
  2. n, m = int(n), int(m)
  3. arr = {}
  4.  
  5. for i in range(m):
  6. x, y = input().split()
  7. if y in arr.keys():
  8. arr[y].add(x)
  9. else:
  10. arr[y] = {x}
  11.  
  12. for i in range(n):
  13. x, y, z = input().split()
  14. if len(arr.get(x, set())) == 0 and {*arr.get(y, set())} <= {x} and {*arr.get(z, set())} <= {x, y}:
  15. print('honest')
  16. else:
  17. print('liar')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement