Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n, m = map(int, input().split())
- d = {}
- for x in range(m):
- a, b = map(int, input().split())
- if b in d:
- d[b] += [a]
- else:
- d.update({b: [a]})
- for x in range(n):
- liar = False
- k = [int(i) for i in input().split()]
- for i in k:
- if i in d:
- for j in d[i]:
- if j not in k:
- liar = True
- break
- else:
- if k.index(j) > k.index(i):
- liar = True
- break
- if liar:
- print('liar')
- else:
- print('honest')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement