Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n, m = input().split()
- n, m = int(n), int(m)
- arr = {}
- for i in range(m):
- x, y = input().split()
- if y in arr.keys():
- arr[y].add(x)
- else:
- arr[y] = {x}
- for i in range(n):
- x, y, z = input().split()
- if len(arr.get(x, set())) == 0 and {*arr.get(y, set())} <= {x} and {*arr.get(z, set())} <= {x, y}:
- print('honest')
- else:
- print('liar')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement