a = set(map(int, input().split()))
b = set(map(int, input().split()))
print(sorted(cartesian_product(a, b)))
