


# excercise 7 all pairs nested loop

# start with a version of just two inputs

infile = open("input7.txt","r")

while True:

# use readline() to read one line at a time

#x = input().strip().split()
#y = input().strip().split()

    x = infile.readline().strip().split()
    y = infile.readline().strip().split()

# we stop when there is no input anymore
    if len(x) == 0:
        break

#    print(x)
#    print(y)

    for i in x:
        xi = int(i)
        out = ""
        for j in y:
            yi = int(j)
#        print(xi,yi)
            out = out + i + " " + j + " "
        print(out)


infile.close()

# when the fist version is correct
# we wrap all up in a loop to read input file
# until the end of file
# in this case we do not actually need xi, yi
# because we just want to print the number out
# we can use its string directly

# match up all pairs from two sets with two nested loop
# is the most common task
# you will see a lot in matrix calculation


