Advertisement
Guest User

Untitled

a guest
Nov 14th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. fin = open('input.txt', 'r', encoding='utf-8')
  2. fout = open('output.txt', 'w', encoding='utf-8')
  3.  
  4.  
  5. def intersection(A, B):
  6. l = [x for x in A if x in B]
  7. return sorted(l)
  8.  
  9.  
  10. A = set(map(int, fin.readline().split()))
  11. B = set(map(int, fin.readline().split()))
  12.  
  13. print(*intersection(A, B), file=fout)
  14. fin.close()
  15. fout.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement