list1 = list(map(int, input().split()))
list2 = list(map(int, input().split()))
list3 = list1 + list2
list3.sort(reverse=True)
print(list3)
list1 = list(map(int, input().split()))
list2 = list(map(int, input().split()))
list3 = list1 + list2
list3.sort(reverse=True)
print(list3)