7-18 sdut-列表去重
li=eval(input())
ans=[]
for i in li:
if i not in ans:
ans.append(i)
print(' '.join(list(map(str,ans))))#list转为str
li=eval(input())
ans=[]
for i in li:
if i not in ans:
ans.append(i)
print(' '.join(list(map(str,ans))))#list转为str