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