Advertisement
Taigar2000

21

Dec 25th, 2020
706
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. d = {}
  2. while(1):
  3.     s = input().strip()
  4.     if(s == 'КОНЕЦ'):
  5.         break
  6.     name, val = s.split('; ')
  7.     d[int(val)] = name
  8. res = {}
  9. for i in list(map(int, input().split())):
  10.     if(i in d):
  11.         res[d[i]] = 1
  12. resstr = ''
  13. for i in sorted(res.keys()):
  14.     resstr += str(i)+', '
  15. print(resstr[:-2])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement