def ex(x, y):

    if x > y:

        tmp = x

        x = y

        y = tmp



    return x, y



def ex2num():

    r1, r2 = input().split(" ")

    r1 = int(r1)

    r2 = int(r2)

    while (0 != r1) or (0 != r2):

        r1, r2 = ex(r1, r2)

        print((r1, r2))

        r1, r2 = input().split(" ")

        r1 = int(r1)

        r2 = int(r2)



    return 0



if __name__ == "__main__":

    ret = ex2num()

def ex2num():

    while (True):

        r1, r2 = input().split(" ")

        r1 = int(r1)

        r2 = int(r2)

        if (0 == r1) and (0 == r2):

            break

        if r1 < r2:

            print((r1, r2))

        else:

            print((r2, r1))



    return 0



if __name__ == "__main__":

    ret = ex2num()

def ex(x, y):
    if x > y:
        tmp = x
        x = y
        y = tmp
    return x, y


def ex2num():
    r1, r2 = input().split(" ")
    r1 = int(r1)
    r2 = int(r2)
    while (0 != r1) or (0 != r2):
        r1, r2 = ex(r1, r2)
        print((r1, r2))
        r1, r2 = input().split(" ")
        r1 = int(r1)
        r2 = int(r2)
    return 0


if __name__ == "__main__":
    ret = ex2num()

def ex2num():
    while True:
        r1, r2 = input().split(" ")
        r1 = int(r1)
        r2 = int(r2)
        if (0 == r1) and (0 == r2):
            break
        if r1 < r2:
            print((r1, r2))
        else:
            print((r2, r1))
    return 0


if __name__ == "__main__":
    ret = ex2num()

-def ex(x, y): -    if x > y: -        tmp = x -        x = y -        y = tmp -    return x, y - - -    r1, r2 = input().split(" ") -    r1 = int(r1) -    r2 = int(r2) -    while (0 != r1) or (0 != r2): -        r1, r2 = ex(r1, r2) -        print((r1, r2)) +    while True: +        if (0 == r1) and (0 == r2): +            break +        if r1 < r2: +            print((r1, r2)) +        else: +            print((r2, r1))