Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- line = set(input())
- condition = 1
- setNew = set()
- while line != {'H', 'E', 'L', 'P'}:
- yesOrNo = input()
- if yesOrNo == 'YES' and condition == 1:
- setNew = line
- condition = 0
- elif yesOrNo == 'YES':
- setNew &= line
- else:
- setNew -= setNew & line
- line = set(input())
- print(' '.join(setNew))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement