Problem:


Swapping Two Numbers

  Write a program which reads two integers x and y, and prints them in ascending order. 

Input

The input consists of multiple datasets. Each dataset consists of two integers x and y separated by a single space.

The input ends with two 0 (when both x and y are zero). Your program should not process for these terminal symbols.
  

Output

For each dataset, print x and y in ascending order in a line. Put a single space between x and y.

Constraints

  
 0 ≤ x, y ≤ 10000

  
 the number of datasets ≤ 3000

Sample Input

3 2
2 2
5 3
0 0

Sample Output

2 3
2 2
3 5



Sample input:
3 2
2 2
5 3
0 0


Sample output:
2 3
2 2
3 5

Submission status: Accepted

Solution code:
import sys
for line in sys.stdin.readlines():
    if line == "0 0\n":
      break
    s = line.split()
    if int(s[0]) > int(s[1]):
      print(s[1], s[0])
    else:
      print(s[0], s[1])

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys

str_lines = [x.strip("\n") for x in sys.stdin.readlines()]

int_lines=[]
for S in str_lines:
  int_lines.append( list( map(int, S.split()) ) )

#-----
for L in int_lines:
  x, y = L
  
  if x == 0 and y == 0:
    break
  else:
    if x > y:
      print(y, x)
    else:
      print(x, y)

Submission status: Accepted

Solution code:
for i in range (10000):
    c,d=map(int,input().split())
    if c==0 and d==0:
        break
    elif c > d:
        print(d,c)
    else:
        print(c,d)

Submission status: Accepted

Solution code:
for i in range(3000):
  x, y = [int(a) for a in input().split()]
  if int(x) > int(y):
    print(str(y) , str(x))
  elif x == 0 and y == 0:
    break
  else:
    print(str(x) , str(y))

Submission status: Accepted

Solution code:
while True:
    a, b = map(int, input().split())
    if a == 0 and b == 0:
        break
    print(min(a, b), end  = " ")
    print(max(a, b))

Submission status: Accepted

Solution code:
while True:
  num = input().split()

  x = int(num[0])
  y = int(num[1])

  if x > y:
    tmp = x
    x = y
    y = tmp
  elif x == y == 0:
    break

  print(str(x) + " " + str(y))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
l=[]
for i in range(1,3000):
  ll=[]
  x,y=(int(i) for i in input().split())
  if x==0 and y==0:
    break
  ll.append(x)
  ll.append(y)
  l.append(ll)

for j in range(len(l)):
  X=min(l[j][0],l[j][1])
  Y=max(l[j][0],l[j][1])
  print(str(X)+" "+str(Y))

Submission status: Accepted

Solution code:
while True:
    a, b = [int(i) for i in input().split()]
    if a == 0 and b == 0:
        break
    if a > b:
        a, b = b, a
    print(a, b)

Submission status: Accepted

Solution code:
while True:
    a, b=input().split()
    a=int(a)
    b=int(b)
    if a==b and a==0:
        break
    
    if a<b:
        print(a,b)
    else :
        print(b,a)

Submission status: Accepted

Solution code:
while True:
    a,b = map(int,input().split())
    
    if (a == 0 and b == 0):
        break

    if (a < b):
        print(a,b)
    else:
        print(b,a)

Submission status: Accepted

Solution code:
while True:
    a,b = map(int, input().split())
    if a == 0 and b == 0:
        break
    if a > b:
        print(f"{b} {a}")
    else:
        print(f"{a} {b}")

Submission status: Accepted

Solution code:
for i in range(10000):
    xy = list(map(int, input().split()))
    if sum(xy) == 0:
        exit()
    print(min(xy), max(xy))

Submission status: Accepted

Solution code:
while True:
    x,y = map(int, input().split())
    if x == 0 and y == 0:
        break
    print(min(x, y), max(x, y))

Submission status: Accepted

Solution code:

for i in iter(input, '0 0'):
    a, b = list(map(int, i.split()))
    if a < b:
        print('%d %d' % (a, b))
    else:
        print('%d %d' % (b, a))

Submission status: Accepted

Solution code:
while True:
    x , y = map(int,input().split())
    if x == 0 and y == 0:
        break
    else :
        if x <= y :
            print(x , y ,sep=" ")
        else :
            print(y , x ,sep=" ")

Submission status: Accepted

Solution code:
while True:
    a,b = (map(int, input().split()))
    if a == 0 and b == 0:
        break
    if a > b:
        print(b,a)
    else:
        print(a,b)

Submission status: Accepted

Solution code:
for i in range(0, 3000):
    x,y = map(int, input().split())
    if x != 0 or y != 0:
        print(min(x,y), max(x, y))
    else:
        break

Submission status: Accepted

Solution code:


while True:
    num_list= list(map(int,input().split()))
    if num_list[0]==num_list[1]==0:
        break
    num_list.sort()
    print(num_list[0],num_list[1])

Submission status: Accepted

Solution code:
for i in range (3000):
    x,y = raw_input().split()
    if int(x) == 0 and int(y) == 0:
        break
    if int(x) > int(y):
        print str(y)+" "+str(x)
    else:
        print str(x)+" "+str(y)

Submission status: Accepted

Solution code:
while True:
    x, y = map(int, input().split())
    if x == 0 and y == 0:
        quit()
    if x <= y:
        print("{} {}".format(x, y))
    else:
        print("{} {}".format(y, x))

Submission status: Accepted

Solution code:
while True :
    x, y = map(int, input().split())
    if x == 0 and y == 0 :
        break
    elif x < y :
        print(x,y)
    else :
        print(y,x)

Submission status: Accepted

Solution code:
while True:    
    x, y = map(int, input().split())
    if x == 0 and y == 0:
        break
    if x < y:
        print("{} {}".format(x, y))
    if x > y:
        print("{} {}".format(y, x))
    if x == y:
        print("{} {}".format(x, y))

Submission status: Accepted

Solution code:
while True:
    data_set = list(map(int,input().split()))
    if data_set[0] == 0 and data_set[1] == 0:
        break
    else:
        data_set.sort()
        print(data_set[0],data_set[1])

Submission status: Accepted

Solution code:
for i in range(3000):
    x,y = sorted(map(int,input().split()))
    if x == 0 and y == 0:
        break
    print(x,y)

Submission status: Accepted

Solution code:
a=[]
while True:
    x,y = map(int,input().split())
    if x==0 and y==0:
        break
    if x<y:
        a.append([x,y])
    if x>y:
        a.append([y,x])
    if x==y:
        a.append([x,y])
for i in range(len(a)):
    print(a[i][0],a[i][1])

Submission status: Accepted

Solution code:
count = 1
while(True):
    x, y = map(int, input().split(' '))
    if x == 0 and y == 0:
        break
    if x > y:
        tmp = x
        x = y
        y = tmp
    print(x, y)

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
while x or y:
    print(x, y) if x<y else print(y,x)
    x,y=map(int,input().split())

Submission status: Accepted

Solution code:
for i in range(3000):
    x, y = map(int, input().split())
    list = [x,y]
    if x==y==0:
        break
    else:
        list = [x,y]
        list.sort()
        print(list[0], list[1])

Submission status: Accepted

Solution code:
for i in range(3000):
    x, y = map(int,input().split())
    if x + y == 0:
        exit()
    else:
        print("%d %d" % (min(x,y),max(x,y)))

Submission status: Accepted

Solution code:
while(True):
    x=list(map(int,input().split()))
    if(x[0]==0 and x[1]==0):
        break
    else:
        x.sort()
        print(str(x[0])+" "+str(x[1]))

Submission status: Accepted

Solution code:
while True:
    x = list(map(int, input().split()))
    if not x[0] and not x[1]:
        break
    else:
        x.sort()
        print(" ".join(map(str,x)))

Submission status: Accepted

Solution code:
import sys

while True:
    l = input()
    a, b = map(int, l.split())
    if a == 0 and b == 0:
        break
    elif a < b:
        print(a, b)
    else:
        print(b, a)

Submission status: Accepted

Solution code:
while True:
    a, b = map(int, input().split())
    if a == 0 and b == 0:
         break
    elif a < b:
        print (a, b)
    else:
        print (b, a)

Submission status: Accepted

Solution code:
while True:
    x,y = map(int,input().split())
    if x == 0 and y == 0:
        break
    if x > y:
        x,y = y,x
    print("{} {}".format(x,y))

Submission status: Accepted

Solution code:
def print_num(a, b):

    if a < b:
        first  = a
        second = b
    else:
        first  = b
        second = a

    print(str(first) + " " + str(second))

if __name__ == "__main__":

    while(1):
        param = input()
        param = param.split(" ")

        a = int(param[0])
        b = int(param[1])

        if a == 0 and b == 0:
            break
        else:
            print_num(a, b)

Submission status: Accepted

Solution code:
while True:
    integer = list(map(int, input().split(" ")))
    if integer[0] == 0 and integer[1] == 0:
        break
    integer.sort()
    print(integer[0], integer[1])

Submission status: Accepted

Solution code:
for xi in range(1, 10000000000000000):
    inline = input().split()
    a, b = (int(xi) for xi in inline)
    if a==0 and b==0:
        break
    if a > b:
        sub = a
        a = b
        b = sub
    print(a, b)

Submission status: Accepted

Solution code:
D = list(map(int, open(0).read().split()))[:-2]
for a, b in zip(*[iter(D)]*2):
    print(f'{min(a, b)} {max(a, b)}')

Submission status: Accepted

Solution code:
while True:
    (a,b) = map(int,input().split())
    if a == 0 and b == 0:
        break
    if a>b:
        (a,b) = (b,a)
    print("%d %d"%(a,b))

Submission status: Accepted

Solution code:

while True:
    x, y = map(int,input().split())
    if(x == 0 and y == 0): 
        break
    if(x >= y):
        print(str(y) + " " + str(x))
    elif(x < y):
        print(str(x) + " " + str(y))

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")

def main():
    xy=list(map(int,input().split()))
    while xy!=[0,0]:
        xy.sort()
        print(*xy)
        xy = list(map(int, input().split()))

main()

Submission status: Accepted

Solution code:
while True:
    x, y = map(int, input().split())
    if (x, y) == (0, 0):
        break
    else:
        if x <= y:
            print(x, y)
        else:
            print(y, x)

Submission status: Accepted

Solution code:
while True:
    x,y = map(int, input().split())
    if x == 0 and y == 0: break
    elif x > y:
        print(y, x)
    else:
        print(x, y)

Submission status: Accepted

Solution code:
while True:
    a, b = map(int, input().split())
    if a == 0 and b == 0:
        break
    if a < b:
        print(a, b)
    else:
        print(b, a)

Submission status: Accepted

Solution code:
while 0 == 0:
    x,y = map(int,input().split())
    if x == y == 0:
        break
    if x < y:
        print(x,y)
    else:
        print(y,x)

Submission status: Accepted

Solution code:
while True:
    a,b = map(int,input().split())
    if a == 0 and b == 0:break
    if a > b:
        print(b,a)
    else:
        print(a,b)

Submission status: Accepted

Solution code:
while True:
    num1,num2 = map(int,input().split())
    if num1 == 0 and num2 == 0:
        break
    elif num1 <= num2:
        print(num1,num2)
    else:
        print(num2,num1)

Submission status: Accepted

Solution code:
while True:
    s = list(map(int, input().split()))
    if s[0] == 0 and s[1] == 0:
        break
    else:
        s.sort()
        print("%d %d" % (s[0], s[1]))

Submission status: Accepted

Solution code:
while True:
    x, y = [int(i) for i in input().split()]
    
    if x == 0 and y == 0:
        break
    
    if x > y:
        x, y = y, x
    
    print("{} {}".format(x, y))

Submission status: Accepted

Solution code:
l=[]
i=0

while True:
    x,y=input().split()

    x=int(x)
    y=int(y)

    if x==y and x==0:
        break
    if x>y:
        w=x
        x=y
        y=w
    l.append([x,y])
    i=i+1

for j in range(i):
    print(l[j][0],l[j][1])

Submission status: Accepted

Solution code:
while True:
    a=list(map(int,input().split()))
    if a != [0,0]:
        a=sorted(a)
        print(*a)
    else:break

Submission status: Accepted

Solution code:
first = 1
second = 1 
while first != 0 or second != 0:
    input_number = input().split()
    first = int(input_number[0])
    second = int(input_number[1])
    if first==0 and second==0:
        break
    elif (first>=second):
        print(second,first)
    else:
        print(first,second)

Submission status: Accepted

Solution code:
while True:
    a, b = map(int, input().split())
    if a == 0 and b == 0:
        break
    print("{} {}".format(min(a, b), max(a, b)))

Submission status: Accepted

Solution code:

while True:
	a, b = map(int, input().split())
	if a == 0 and b == 0:
		break
	elif a > b:
		print(b, a)
	else:
		print(a, b)

Submission status: Accepted

Solution code:
import sys
for i,line in enumerate(sys.stdin):
  a,b = map(int, line.strip().split(' '))
  if a == 0 and b == 0: exit()
  if a > b: a,b = b,a
  print(a,b)

Submission status: Accepted

Solution code:
while True:
    l = list(map(int, input().split()))
    a,b = l[0],l[1]
    if a == 0 and b == 0:
        break
    if a > b:
        a,b = l[1],l[0]
    print("%d %d" %(a,b))

Submission status: Accepted

Solution code:
while True:
    data = list(map(int,input().split()))
    if (data[0] == 0) and (data[1] == 0):
        break
    data.sort()
    print(data[0],data[1])

Submission status: Accepted

Solution code:
for i in range(3000):
  x,y = map(int,input().split())
  if x == 0 and y == 0:
    break
  else:
    print(min(x,y),max(x,y))

Submission status: Accepted

Solution code:
while True:
    n = input().split()
    x,y = map(int,n)
    if x == 0 and y == 0:
        break
    if x > y:
        x,y = y,x
    print(f"{x} {y}")

Submission status: Accepted

Solution code:
list = []
for i in range(10001):
    a, b = (int(x) for x in input().split())
    if a == 0 and b == 0:
        break
    list.append([min(a,b), max(a, b)])
for n in range(len(list)):
    print(str(list[n][0]), str(list[n][1]))

Submission status: Accepted

Solution code:
while True:
    x, y = map(int, input().split())
    if x == y == 0:
        break
    elif x < y:
        print(x, y)
    else:
        print(y, x)

Submission status: Accepted

Solution code:
while True:
    l = input()
    a, b = map(int, l.split())
    if a == 0 and b == 0:
        break
    if a > b:
        print(b, a)
    else:
        print(a, b)

Submission status: Accepted

Solution code:
while True:
    x,y = map(int,input().split())
    if x == 0 and y == 0:
        break
    print(min(x,y),max(x,y))

Submission status: Accepted

Solution code:

while True:
    a,b = map(int, input().split())
    if a==0 and b==0:
        break
    if a>b:
        print(b,a,sep=' ')
    else:
        print(a,b,sep=' ')

Submission status: Accepted

Solution code:
while True:
	x,y = map(int, input().split())
	if x == 0 and y == 0: break
	if x > y:
		print(y, x)
	else:
		print(x, y)

Submission status: Accepted

Solution code:
while True:
    a, b = map(int, input().split())
    if a == 0 and b == 0:
        break
    elif a <= b:
        print(str(a) + ' ' + str(b))
    else:
        print(str(b) + ' ' + str(a))

Submission status: Accepted

Solution code:
i = 0
while i < 3000:
    l = input()
    x, y = [int(i) for i in l.split()]
    if x == y == 0:
        break
    
    if x > y:
        x, y = y, x
    print(x, y)
    i += 1

Submission status: Accepted

Solution code:
while True:
    A = [int(x) for x in input().split(' ')]
    if A[0] == A[1] == 0:
        break
    A.sort()
    print(A[0], A[1])

Submission status: Accepted

Solution code:
while True:
  a, b = map(int, input().split())
  if a + b == 0:
    break
  if a > b:
    a, b = b, a
  print(f"{a} {b}")

Submission status: Accepted

Solution code:
while True:
    x,y = map(int, input().split())
    if x == y == 0:
        break
    elif x <= y:
        print(x, y)
    else:
        print(y, x)

Submission status: Accepted

Solution code:
i=0
while True:
    x,y=(int(x) for x in input().split())
    if x==0 and y==0:
        break
    if x>y:
        x,y=y,x
    print(x, y)

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
while (not((x==0) and (y==0))):
    if (x<y):
        print(str(x)+' '+str(y))
    else:
        print(str(y)+' '+str(x))
    x, y = map(int, input().split())

Submission status: Accepted

Solution code:
while True:
    X,Y = map(int, input().split())
    if X==0 and Y==0:
        exit()
    else:
        if X>Y:
            print(Y,X)
        else:
            print(X,Y)

Submission status: Accepted

Solution code:
while True:
    a,b = map(int, input().split())
    if a == 0 and b == 0: break
    if a < b:
        print(a, b)
    else:
        print(b, a)

Submission status: Accepted

Solution code:
while True:
  i = input()
  x,y = map(int, i.split())
  
  if x == 0 and y == 0:
    break

  if x > y:
    z = x
    x = y
    y = z

  print(f"{x} {y}")

Submission status: Accepted

Solution code:

for i in range(1,3000):
    nums=input()
    n_list=nums.split()
    x=int(n_list[0])
    y=int(n_list[1])
    if x==0 and y==0:
        break
    if x<y:
        print(x,y)
    else:
        print(y,x)

Submission status: Accepted

Solution code:
while True:
    x,y = map(int,input().split())
    if x == 0 and y ==0:
        break
    elif x > y:
        x,y = y,x
    print("%d %d" %(x,y))

Submission status: Accepted

Solution code:

def Swap(a,b):
    if a > b:
        a,b = b,a
    return a,b


def main():
    while True:
        a, b= map(int, input().split())
        if a == 0 and b == 0:
            break
        else:
            a,b = Swap(a,b)
            print("%d %d" %(a,b))

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
while True:
    x,y = map(int, input().split())
    if x == 0 and y == 0:
        break
    elif x>y:
        x,y=y,x
        print("{} {}".format(x,y))
    else:
        print("{} {}".format(x,y))

Submission status: Accepted

Solution code:
x = 1
y = 1
while x != 0 or y != 0:
    l = list(map(int,input().split()))

    x = l[0]
    y = l[1]

    if x == 0 and y == 0:
        break

    if x < y:
        print(str(x) + ' ' + str(y))
    else:
        print(str(y) + ' ' + str(x))

Submission status: Accepted

Solution code:
while True:
    x,y = map(int,input().split())
    if x == 0 and y == 0:
        break
    if x < y:
        print(f"{x} {y}")
    else:
        print(f"{y} {x}")

Submission status: Accepted

Solution code:
while True:
    a,b = map(int,input().split())
    if a==0 and b == 0:
        break
    else:
        a,b = min(a,b),max(a,b)
        print('{} {}'.format(a,b))

Submission status: Accepted

Solution code:
while True:
    a=input().split(" ")
    x=int(a[0])
    y=int(a[1])
    if x==y==0:
        break
    elif x<=y:
        print(str(x)+" "+str(y))
    elif x>y:
        print(str(y)+" "+str(x))

Submission status: Accepted

Solution code:

i = 0
f = 0
while True:
    x,y = map(int,input().split())
    i +=1
    if x == y == 0:
        break
    else:
        if x<y:
            print(f"{x} {y}")
        else:
            print(f"{y} {x}")

Submission status: Accepted

Solution code:
def main():
    x, y = (int(i) for i in input().split())
    while x != 0 or y != 0:
        if x > y:
            x, y = y, x
        print(x,y)
        x, y = (int(i) for i in input().split())

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
while True:
    x,y=list(map(int,input().split()))
    if x==0 and y==0:
        break
    if x>y:
        print(y,x)
    else:
        print(x,y)

Submission status: Accepted

Solution code:
while True:
    a,b = map(int, input().split())
    if a == 0 and b == 0: break
    if a > b:
        print(b, a)
    else:
        print(a, b)

Submission status: Accepted

Solution code:

while True:
    x,y=map(int,input().split())
    
    if x==0 and y==0:
        break
    
    elif x<y:
        print(x,y)
    else:
        print(y,x)

Submission status: Accepted

Solution code:
import sys

while True:
  x,y=list(map(int,input().split()))
  if x==0 and y==0:
    break
  if x>y:
    x,y=y,x
  print(x,y)

Submission status: Accepted

Solution code:
while True:
  a,b=map(int,input().split())
  if  a == b ==0 :
    exit()
  elif a >= b :
    print(b,a)
  else:
    print(a,b)

Submission status: Accepted

Solution code:
while True:
    x,y = map(int,input().split())
    if x == 0 and y == 0:
        break
    elif x > y:
        print(y,x)
    elif y < x:
        print(x,y)
    else:
        print(x,y)

Submission status: Accepted

Solution code:
for i in range(10000):
    a,b = map(int,input().split())
    if a == 0 and b == 0:
        break
        
    elif a > b:
        print("{} {}".format(b,a))
    else:
        print("{} {}".format(a,b))

Submission status: Accepted

Solution code:
i = 1
a = []
b = []

while True :
    x, y = map(int, input().split())
    if x == 0 and y == 0 :
        break
    a.append(x)
    b.append(y)
    i += 1
    
for j in range(1, i) :
    if a[j - 1] < b[j - 1] :
        print(a[j - 1], b[j - 1])
    else :
        print(b[j - 1], a[j - 1])

Submission status: Accepted

Solution code:
while True:
    nums = list(map(int, input().split(" ")))
    if nums[0] == nums[1] and nums[1] == 0:
        break
    else:
        if nums[0] > nums[1]:
            nums[0], nums[1] = nums[1] ,nums[0]
        print("%d %d" %(nums[0], nums[1]))

Submission status: Accepted

Solution code:
while True:
    x = list(map(int,input().split()))
    if x[0] == 0 and x[1] == 0:
        break
    else:
        x = sorted(x)
        print(x[0], x[1])

Submission status: Accepted

Solution code:
while True :
    n = input().split()
    x = int(n[0])
    y = int(n[1])
    if x == 0 and y == 0:
        break
    if x < y:
        print(str(x) + " " + str(y))
    else :
        print(str(y) + " " + str(x))

Submission status: Accepted

Solution code:
while True:
    xylist = []
    xylist = list(map(int, input().split()))
    if xylist[0] == xylist[1] == 0:
        break
    else:
        print(*sorted(xylist))

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
while x != 0 or y != 0 :
    if x > y :
        x = x + y
        y = x - y
        x = x - y
    print(x,y)
    x, y = map(int, input().split())

Submission status: Accepted

Solution code:
for i in range (3000):
    x, y = map(int, input().split(" "))
    if x == y == 0:
        break
    elif x >= y:
        print(y, x)
    elif x < y:
        print(x, y)

Submission status: Accepted

Solution code:
while True:
    try:
        nums = [int(e) for e in input().split()]
        if nums[0] == 0 and nums[1] == 0:break
        nums.sort()
        print(str(nums[0]) + " " + str(nums[1]))
    except EOFError:
        break

Submission status: Accepted

Solution code:
while True:
    x, y = (int(a) for a in input().split())
    if x == 0 and y == 0:
        break
    if x > y:
        tmp = x
        x = y
        y = tmp
    print(str(x) + ' ' + str(y))

Submission status: Accepted

Solution code:
while True:
    x,y=map(int,input().split())
    if x==0 and y==0:
        break
    else:
        print(min(x,y),max(x,y))

Submission status: Accepted

Solution code:
while True:
    li = list( map( int, input().split() ) )
    
    if(li[0] == 0 and li[1] == 0):
        break
    
    li.sort()
    print(li[0], li[1])

Submission status: Accepted

Solution code:
while True:
    nums = input()
    a, b = map(int, nums.split())

    if a == 0 and b == 0:
        break

    if a > b:
        print(b, a)
    else:
        print(a, b)

Submission status: Accepted

Solution code:
while True:
    x,y = map(int,input().split())
    if x == y == 0:
        break
    elif x > y:
        print(y,x)
    else:
        print(x,y)

Submission status: Accepted

Solution code:
while True:
    x, y = map(int,input().split())
    if x == 0 and y == 0:
        break
    if x > y:
        x, y = y, x
    print(x, y)

Submission status: Accepted

Solution code:
ans=[]
while 1:
    a,b=map(int,input().split())
    if a==0 and b==0:break
    if a>=b:a,b=b,a
    ans.append((a,b))

for x,y in ans:
    print(x,y)

Submission status: Accepted

Solution code:

while True:
    a, b = input().split()
    a, b = eval(a), eval(b)
    if a == 0 and b == 0:
        break
    if a > b:
        print(str(b) + " " + str(a))
    else:
        print(str(a) + " " + str(b))

Submission status: Accepted

Solution code:
while True:
    line=input().split()
    a,b=map(int,line)
    if a==0 and b==0:
        break
    if a >= b:
        print(f"{b} {a}")
    else:
        print(f"{a} {b}")

Submission status: Accepted

Solution code:
i_list = []
while True:
    i_list.append(list(map(int, input().split())))
    if i_list[-1][0] == i_list[-1][1] == 0:
        break

for i in range(len(i_list)-1):
	i_list[i].sort()
	print(*i_list[i])

Submission status: Accepted

Solution code:
li = [int(i) for i in input().split()]
while any(li):
    print(*sorted(li))
    li = [int(i) for i in input().split()]

Submission status: Accepted

Solution code:
import sys

while True:
    x, y = [int(i) for i in input().split()]
    if x == 0 and y == 0:
        sys.exit()
    else:
        if x <= y:
            print(x, y)
        else:
            print(y, x)

Submission status: Accepted

Solution code:
while True:
    a, b = map(int, input().split())
    if a == 0 and b == 0:
        break
    if a > b:
        a, b = b, a
    print(a, b)

Submission status: Accepted

Solution code:
l=list(map(int,input().split()))
while l!=[0,0]:
    print(min(l),max(l))
    l=list(map(int,input().split()))

Submission status: Accepted

Solution code:
while True:
    x,y = map(int,input().split())
    if x == 0 and y == 0:
        break

    if x > y:
       print(y, x)
    else:
       print(x, y)

Submission status: Accepted

Solution code:
while True:
    x, y = map(int, input().split())
    if x == 0 and y == 0:
        break
    elif x < y:
        print("%d %d" % (x, y))
    else:
        print("%d %d" % (y, x))

Submission status: Accepted

Solution code:
x = 0

while x == 0:
    a = list(map(int, input().split()))
    if a[0] == 0 and a[1] == 0:
        break
    else:
        if a[0] >= a[1]:
            print(a[1], a[0])
        else:
            print(a[0], a[1])

Submission status: Accepted

Solution code:
A = []
while True:
    a, b = map(int, input().split())
    if a == b == 0:
        break
    else:
        B = []
        B.append(a)
        B.append(b)
        A.append(B)
        
for i in A:
    i.sort()
    print("{} {}".format(i[0],i[1]))

Submission status: Accepted

Solution code:
while True:
    a, b = map(int, input().split())
    if a == 0 and b == 0:
        break
    
    if a >= b:
        print(str(b) + " " + str(a))
    else:
        print(str(a) + " " + str(b))

Submission status: Accepted

Solution code:
# ITP1_3_C
a =[]
while True:
    x, y = (int(x) for x in input().split())
    if x == 0 and y ==0:
        break
    z = [x, y]
    z.sort()
    z = [z]
    a = a + z
for i in range(len(a)):
    print(str(a[i][0]) + ' ' + str(a[i][1]))

Submission status: Accepted

Solution code:
def main():
    a = list(map(int,input().split()))
    a.sort()
    if a[0] == 0 and a[1] == 0:
        return False
    print(f"{a[0]} {a[1]}")
    return True

while main():
    pass

Submission status: Accepted

Solution code:
li = []
for i in range(0, 3000):
    buf = list(map(int, input().split(' ')))
    if buf[0] == buf[1] == 0:
        break

    li.append(buf)

for i in li:
    if i[0] < i[1]:
        print('%d %d' % (i[0], i[1]))
    else:
        print('%d %d' % (i[1], i[0]))

Submission status: Accepted

Solution code:
a,b = (int(x) for x in input().split())
while(a != 0 or b != 0):
    if a > b:
        tmp = a
        a = b
        b = tmp
    print(a,b)
    a,b = (int(x) for x in input().split())

Submission status: Accepted

Solution code:
while True:
    a,b = [int(x) for x in input().split()]
    if a == 0 and b == 0:
        exit(0)
    if a > b:
        print(b,a)
    else:
        print(a,b)

Submission status: Accepted

Solution code:
while True:
    x, y = map(int, input().strip().split())
    if x > y:
        print(y, x)
    elif x == 0 and y == 0:
        break
    else:
        print(x, y)

Submission status: Accepted

Solution code:
while True:
    l = input().split()
    x = int(l[0])
    y = int(l[1])
    if x>y:
        x,y = y,x
    elif x==0 and y==0:
        break
    else:
        pass
    print(x,y)

Submission status: Accepted

Solution code:
i = 1
x, y = map(int, input().split())
while x != 0 or y != 0:
    if i <= 3000:
        if x > y:
            print(str(y), str(x))
        else:
            print(str(x), str(y))
        x, y = map(int, input().split())
        i += 1
    else:
        x = 0
        y = 0

Submission status: Accepted

Solution code:
import sys
for s in sys.stdin:
    if s=='0 0\n':
        break
    print(*sorted(map(int, s.split())))

Submission status: Accepted

Solution code:
while(1):
    x,y = map(int,input().split())
    if x == 0 and y == 0:
        break
    else:
        print(str(min(x,y)) + " " + str(max(x,y)))

Submission status: Accepted

Solution code:
for i in range(1,3100):
    a,b=map(int,input().split())
    if a==0 and b==0:
        break
    if a>b:
        a,b=b,a
    print("%d %d" % (a,b))

Submission status: Accepted

Solution code:
while True:
    a,b = map(int, input().split())
    if a == b == 0:
        break
    else:
        print("%d %d" %(min(a,b), max(a,b)))

Submission status: Accepted

Solution code:
def test():

	count = 0
	output = [[0 for i in range(3000)] for j in range(2)]

	while True:
		i = list(map(int,input().split()))
		if i[0] == 0 and i[1] == 0:
			break

		if i[0] > i[1]:
			output[0][count] = i[1]
			output[1][count] = i[0]
		else:
			output[0][count] = i[0]
			output[1][count] = i[1]

		count += 1
	
	loop = 0
	for loop in range(count):
		print(f"{output[0][loop]} {output[1][loop]}")

if __name__ == "__main__":
	test()

Submission status: Accepted

Solution code:
# coding: utf-8

while True:
    x, y = map(int, input().split())
    if x + y == 0:
        break
    if x > y:
        z = x
        x = y
        y = z
    print('{0} {1}'.format(x, y))

Submission status: Accepted

Solution code:
while True:
    s = input().split()
    a = int(s[0])
    b = int(s[1])
    if a==0 and b==0:
        break
    if b<a:
        print(b,a)
    else:
        print(a,b)

Submission status: Accepted

Solution code:
while True:
    x, y = map(int, input().split())
    
    if x == 0 and y == 0:
        break
    
    if x < y:
        print(x, y)
    else:
        print(y, x)

Submission status: Accepted

Solution code:
while True:
    x, y = map(int, input().split())
    if x == 0 and y == 0:
        break
    else:
        x, y = min([x, y]), max([x, y])
        print(x, y)

Submission status: Accepted

Solution code:
i=0
while (1):
    i=i+1
    x,y=map(int,input().split())
    if (x==0)&(y==0):
        break
    print(min(x,y),max(x,y))

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
while not (x == 0 and y == 0):
    print(" ".join([str(i) for i in sorted([x, y])]))
    x, y = map(int, input().split())

Submission status: Accepted

Solution code:
datasets = []
while True:
    data = list(map(int, input().split(' ')))
    if data[0] == 0 and data[1] == 0:
        break
    datasets.append(sorted(data))
for d in datasets:
    print(' '.join(map(str, d)))

Submission status: Accepted

Solution code:
while True:
    a,b = map(int, input().split())
    if a == 0 and b == 0: break
    if a > b:
        print(b, a)
    else:
        print(a, b)