fork download
  1. t = int(input())
  2. while(t!=0):
  3. x=input()
  4. y=input()
  5. temp=0
  6. a=[]
  7. for i in x:
  8. temp=0
  9. for j in y:
  10. if(i==j):
  11. temp=1
  12. break
  13. if(temp==0):
  14. a.append(i)
  15.  
  16.  
  17. b=[]
  18. for j in y:
  19. temp=0
  20. for i in x:
  21. if(i==j):
  22. temp=1
  23. break
  24. if(temp==0):
  25. b.append(j)
  26.  
  27.  
  28. c=a+b
  29. c.sort()
  30. s=set(c)
  31. c=list(s)
  32. c.sort()
  33.  
  34. #print(len(c))
  35. if (len(c)!=0):
  36. print(''.join(c))
  37. t=t-1
  38.  
Success #stdin #stdout 0.02s 28384KB
stdin
3
asdf
ascv
aab
ab
abc
deff
stdout
cdfv
abcdef