input = input('Enter ten numbers: ')

list1 = input.split()
list2 = []

for number in list1:
    if list2:
        exist = False
        for n in list2:
            if n == number:
                exist = True
                break
        if (not exist):
            list2.append(number)
    else:
        list2.append(number)

print ('The distinct numbers are: ', end='')

for n in list2:
    print (n, end=' ')

print ()

input = input('Enter ten numbers: ')

list1 = input.split()
list2 = []

for number in list1:
    if list2:
        exist = False
        for n in list2:
            if n == number:
                exist = True
                break
        if (not exist):
            list2.append(number)
    else:
        list2.append(number)

print ('The distinct numbers are: ', end='')

for n in list2:
    print (n, end=' ')

print ()
