Advertisement
Guest User

Untitled

a guest
Oct 5th, 2015
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. import sys
  2. pres = (input().rstrip()).split(" ")
  3. while "" in pres:
  4. del pres[pres.index("")]
  5.  
  6. indices = set()
  7. for line in sys.stdin:
  8. words = line.rstrip().split(" ")
  9. while "" in words:
  10. del words[words.index("")]
  11. for i in range(len(words)):
  12. for j in pres:
  13. if j == words[i]:
  14. indices.add(i+1)
  15. for i in sorted(indices):
  16. print(i, end = " "
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement