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
       
while True:
    (x, y) = [int(i) for i in sys.stdin.readline().split()]
       
    if x == 0 and y == 0:
        break
       
    if x > y:
        z = x
        x = y
        y = z
       
    print(x, y)

Submission status: Accepted

Solution code:
from sys import stdin

for line in range(3000 + 5):
    x , y = map( int, stdin.readline().split() )

    if not ( x + y):
       break

    if x > y:
       x , y = y , x

    print(x, y)

Submission status: Accepted

Solution code:
xy_data=[]
while True:
    xy=list(map(int,input().split()))
    xy.sort()
    if xy[0]==xy[1]==0:
        break
    else:
        xy_data.append(xy)
for xy in xy_data:
    print(*xy)

Submission status: Accepted

Solution code:
### 17.07.2017
n = []
while (True):
	x = list(map(int,input().split()))
	if x[0] == 0 and x[1] == 0:
		break
	n.append(x)
for i in n:
	if i[0] > i[1]:
		print(i[1], i[0])
	else:
		print(i[0], i[1])

Submission status: Accepted

Solution code:
while 1:
	x = map(int,raw_input().split())
	
	if x[0]+x[1] == 0:
		break

	if x[0] > x[1]:
		tmp = x[0]
		x[0] = x[1]
		x[1] = tmp
	
	print x[0],x[1]

Submission status: Accepted

Solution code:
import sys
   
ff = sys.stdin
   
while True :
    a, b = map(int, ff.readline().split())
    if (a == 0) & (b == 0) :
        break
   
    if a < b : print(a, b)
    else : print(b, a)

Submission status: Accepted

Solution code:
import sys
    
num = sys.stdin
    
while True :
    a, b = map(int, num.readline().split())
    if (a == 0) & (b == 0) :
        break
    
    if a < b : print(a, b)
    else : print(b, a)

Submission status: Accepted

Solution code:
import sys
    
while True :
    a, b = map(int, sys.stdin.readline().split())
    if (a == 0) & (b == 0) :
        break
    
    if a < b : print(a, b)
    else : print(b, a)

Submission status: Accepted

Solution code:
import sys    
while True :
    a, b = map(int, sys.stdin.readline().split())
    if (a == 0) & (b == 0) :
        break
     
    if a < b : print(a, b)
    else : print(b, a)

Submission status: Accepted

Solution code:
import sys    
while True :
    a, b = map(int, sys.stdin.readline().split())
    if (a == 0) & (b == 0) :
        break
    if a < b : print(a, b)
    else : print(b, a)

Submission status: Accepted

Solution code:
import sys
while True:
    a,b=map(int,sys.stdin.readline().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:
	x, y = sorted(map(int, input().split()))
	if x == 0 and y == 0:
		break
	print(x, y)

Submission status: Accepted

Solution code:
while True:
	x, y = sorted(map(int, input().split()))
	if (x, y) == (0, 0):
		break
	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:
list1=[]
while True:
    x = input("")
    if x == "0 0":
        break
    else:
        list1.append(x)

for i,v in enumerate(list1):
    x,y = map(int,v.split())
    if x <= y:
        print(str(x) + " " + str(y))
    else:
        print(str(y) + " " + str(x))

Submission status: Accepted

Solution code:
while True:
    inputlines = list(map(int, input().split()))
    if inputlines[0] == 0 and inputlines[1] == 0:
        break
    sorted_list = sorted(inputlines)
    print(' '.join(map(str, sorted_list)))

Submission status: Accepted

Solution code:
while True:
    a = map(int, raw_input().split())
    if a.count(0) == 2:
        break
    else:
        print(str(min(a)) + " " + str(max(a)))

Submission status: Accepted

Solution code:
ret = []
while True:
    x = raw_input().split()
    if int(x[0]) == int(x[1]) == 0: break

    if int(x[0]) > int(x[1]):
        ret += ['%s %s' % (x[1], x[0])]
    else:
        ret += ['%s %s' % (x[0], x[1])]

for x in ret:
    print(x)

Submission status: Accepted

Solution code:
while True:
    inputted_str = input().split()
    x = int(inputted_str[0])
    y = int(inputted_str[1])

    if x == 0 and y == 0:
        break
    elif x < y:
        print("{} {}".format(x, y))
    else:
        print("{} {}".format(y, x))

Submission status: Accepted

Solution code:
ret = []
while True:
    x, y = map(int, raw_input().split())
    if x == y == 0:      
        break
    if x < y:
        #ret += ['%s %s' % (x,y)]
        print('%s %s' % (x,y))
    else:
        #ret += ['%s %s' % (y,x)]
        print('%s %s' % (y,x))
#for r in ret:
    #print(r)

Submission status: Accepted

Solution code:
ret = []
while True:
    x, y = map(int, raw_input().split())
    if x == y == 0:      
        break
    if x < y:
        print('%s %s' % (x,y))
    else:
        print('%s %s' % (y,x))

Submission status: Accepted

Solution code:
for i in range(1, 3005):
    x = input().split(" ")
    a = int(x[0])
    b = int(x[1])
    if a + b == 0:
        break
    if a < b:
        print(str(a) + " " + str(b))
    else:
        print(str(b) + " " + str(a))

Submission status: Accepted

Solution code:
numbers = []
while True:
    num = list(map(int, input().split()))
    if num[0] == 0 and num[1] == 0:
        break
    else:
        numbers.append(num)

for n in numbers:
    print(str(min(n)) + " " + str(max(n)))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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):
        print(y,x)
    else:
        print(x,y)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = []
while True:
    l = list(map(int,input().split()))
    if l == [0,0]:
        break
    else:
        l.sort()
        s.append(str(l[0]) + " " + str(l[1]))
for j in range(len(s)):
    print(s[j])

Submission status: Accepted

Solution code:
while True:
	[a, b] = [int(number) for number in input().split()];
	if (a == 0) & (b == 0):
		break;
	
	if (a < b):
		print(str(a) + ' ' + str(b));
	else:
		print(str(b) + ' ' + str(a));

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Aizu Problem ITP_1_3_C: Swapping Two Numbers
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


while True:
    a, b = [int(_) for _ in input().split()]
    if a == b == 0:
        break
    print(min(a, b), max(a, b))

Submission status: Accepted

Solution code:
dataset = []

while True:
    s = list(map(int,input().split()))
    try:
        if s[0] == 0 and s[1] == 0:
            break
        dataset.append(s)
    except:
        continue

for row in dataset:
    row.sort(key=int)
    print(row[0],row[1])

Submission status: Accepted

Solution code:
while True:
    x=input().split()
    if x == ["0","0"]:
        break
    x=list(map(int,x))
    x= sorted(x)
    a,b=x[0], x[1]
    print("{0} {1}".format(a,b))

Submission status: Accepted

Solution code:
while 1:
  x,y = map(int,raw_input().split())
  if x==0 and y==0:
    break
  else:
    n=[x,y]
    n.sort()
    print n[0],n[1]

Submission status: Accepted

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

    print('{} {}'.format(x, y))

Submission status: Accepted

Solution code:
import sys
 
while True :
    a, b = map(int, sys.stdin.readline().split())
    if (a == 0) & (b == 0) :
        break
    
    if a < b : print(a, b)
    else : print(b, a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:

  x, y = map(int, raw_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:
    x, y = map(int, input().split())
    if x == y == 0:
        break
    if x < y:
        small = x
        large = y
    else:
        small = y
        large = x
    print("{0} {1}".format(small, large))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while 1:
    n = map(int,raw_input().split())
    if n[0] == n[1] == 0:
        break
    n.sort()
    print n[0],n[1]

Submission status: Accepted

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

    if (x == 0) & (y == 0) :
        break
    elif x > y :
        print(y, x)
    else :
        print(str(x) + " " + str(y))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

while True:
    n = input().rstrip().split(" ")
    if n != ["0", "0"]:
        if int(n[0]) > int(n[1]):
            print(n[1] + " " + n[0])
        else:
            print(" ".join(n))
    else:
        break

Submission status: Accepted

Solution code:
I = input().split()
x = int(I[0])
y = int(I[1])
while x != 0 or y != 0:
    if x < y:
        print(str(x) + ' ' + str(y))
    if x > y:
        print(str(y) + ' ' + str(x))
    if x == y:
        print(str(x) + ' ' + str(y))
    I = input().split()
    x = int(I[0])
    y = int(I[1])

Submission status: Accepted

Solution code:
import sys

for line in range(3000):
    x,y = map(int,sys.stdin.readline().split())

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

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

Submission status: Accepted

Solution code:
while 1:
    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:
    a=sorted(map(int,input().split()))
    if a==[0,0]:
        quit()
    print(*a)

Submission status: Accepted

Solution code:
a=0
b=0

while True:

    
    
    a,b=map(int,input().split())

    if a!=0 or b!=0:
        

        if a>b:
            a,b=b,a

        print(a,b)

    else:
        break

Submission status: Accepted

Solution code:
while 1:
    a,b=input().split()
    a=int(a);b=int(b)
    if a==0 and b==0:
        break
        
    elif a>b:
        c=a;a=b;b=c
    print(a,b)

Submission status: Accepted

Solution code:
while True:
    x,y=map(int,input().split())
    if x+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:
    print(b,a)

  elif b>a:
    print(a,b)

  elif a==b==0:
    break

  else:
    print(a,b)

Submission status: Accepted

Solution code:
while True:
    s = input()

    if s == "0 0":
        break
    else:
        print(" ".join(map(str, sorted(map(int, s.split())))))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
nums1=[]
nums2=[]
while True:
    num=[]
    num=input().split()
    for i in range(0,len(num)):
        num[i]=int(num[i])
    if num[0]==0 and num[1]==0:
        break
    nums1.append(num[0])
    nums2.append(num[1])

for i in range(0,len(nums1)):
    if nums1[i]<nums2[i]:
        print(nums1[i],nums2[i])
    else:
        print(nums2[i],nums1[i])

Submission status: Accepted

Solution code:
for i in range(3000):
    x = list(input().split(" "))
    idx = 0
    if x[0] == "0" and x[1] == "0":
        break
    for j in x:
        x[idx] = int(j)
        idx += 1
    x.sort()
    print(x[0], x[1])

Submission status: Accepted

Solution code:
for i in range(3000):
    x = list(input().split(" "))
    if x[0] == "0" and x[1] == "0":
        break
    idx = 0
    for j in x:
        x[idx] = int(j)
        idx += 1
    x.sort()
    print(x[0], x[1])

Submission status: Accepted

Solution code:
result = []
while True:
    my_value = input()
    my_value_list = []
    my_value_list = ([int(x) for x in my_value.split()])
    my_value_list.sort()
    result.append(my_value_list)
    if my_value_list[0] == 0 and my_value_list[1] == 0:
        result.pop()
        break

for i in range(0, len(result)):
    print("{} {}".format(result[i][0], result[i][1]))

Submission status: Accepted

Solution code:
import sys
for line in sys.stdin:
    x, y = map(int, line.split())
    if x == y == 0:
        break
    if x <= y:
        print(x, y)
    else:
        print(y, x)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# (c) midandfeed
while(True):
	a, b = [int(x) for x in input().split()]
	if ( (a==0) and (b==0) ):
		break
	print( min(a,b), max(a,b) )

Submission status: Accepted

Solution code:
while 1:
    x,y = map(int,input().split())
    if not x+y:break
    if x > y : x,y = y,x
    print(x,y)

Submission status: Accepted

Solution code:
import sys
for i in sys.stdin:
    a, b = sorted(map(int, i.split()))
    if a != 0 or b != 0:
        print(a, b)
    else:
        break

Submission status: Accepted

Solution code:
import sys
for xy in sys.stdin:
    x, y  = xy.split()
    if x == '0' and y == '0':
        break
    elif int(x) > int(y):
        x, y = y, x
    print('%s %s'%(x, y))

Submission status: Accepted

Solution code:
for cnt in range(3000):
    
    l = [int(i) for i in input().split()]
    
    if l == [0,0]:
        break
    else:
        l.sort()
        print (str(l[0]) + " " + str(l[1]))

Submission status: Accepted

Solution code:
while True:
    line = list(map(int, input().split()))
    if line == [0, 0]:
        break
    line.sort()
    print('%d %d' % tuple(line))

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:
import sys

for line in sys.stdin:
    x, y = line.strip().split()
    if x == y == "0":
        break
    if int(x) > int(y):
        print y, x
    else:
        print x, y

Submission status: Accepted

Solution code:
import sys
while True:
    x = sys.stdin.readline().strip()
    if x == "0 0":
        break
    a = list(map(int, x.split()))
    a.sort()
    print("{} {}".format(a[0], a[1]))

Submission status: Accepted

Solution code:
x = []
y = []

i = 0

while True:
    indata = input().split()
    x.append(indata[0])
    y.append(indata[1])
    if int(x[i]) == 0 and int(y[i]) == 0:
        break
    i += 1

for j in range(len(x)):
    if int(x[j]) == 0 and int(y[j]) == 0:
        pass
    else:
        if int(x[j]) < int(y[j]):
            print("{0} {1}".format(x[j],y[j]))
        else:
            print("{0} {1}".format(y[j],x[j]))

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:
import sys

while 1:
  x,y= sys.stdin.readline().split()
  if x == y == "0":
   break
  elif int(x)>int(y):
   print(y,x)
  else:
   print(x,y)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:
    l = [int(s) for s in input().split()]
    if sum(l) == 0:
        break
    print(' '.join([str(i) for i in sorted(l)]))

Submission status: Accepted

Solution code:
import sys
 
 
list_line = sys.stdin.readlines()
 
for index, element in enumerate(list_line):
    list_line[index] = element.rstrip('\n')
 
for element in list_line:
    x_y_list = element.split(" ")
    x = int(x_y_list[0])
    y = int(x_y_list[1])
    if x == 0 and y == 0:
        sys.exit()
    if x > y:
        print(str(y) + " " + str(x))
    else:
        print(element)

Submission status: Accepted

Solution code:
n=[]
line=''
while line != [0,0]:
    line=list(map(int,input().split()))
    n.append(line)
for i in range(len(n)-1):
    print('%d %d'%(n[i][0] if n[i][0]<=n[i][1] else n[i][1],n[i][0] if n[i][0]>=n[i][1] else n[i][1]))

Submission status: Accepted

Solution code:
import sys
def main():
    for line in sys.stdin:
        x, y = map(int, line.split())
        if x == 0 and y == 0:
            break
        else:
            if x > y:
                tmp = y
                y = x
                x = tmp
            print(x, y)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
S = raw_input().split(" ")
S[0] = int(S[0])
S[1] = int(S[1])

while S[0] != 0 or S[1] != 0:
  if(S[0] < S[1]):
    print(str(S[0]) + " " + str(S[1]))
  else:
    print(str(S[1]) + " " + str(S[0]))
  S = raw_input().split(" ")
  S[0] = int(S[0])
  S[1] = int(S[1])

Submission status: Accepted

Solution code:
while True:
	num = raw_input().split(" ")
	num1 = int(num[0])
	num2 = int(num[1])
	if num1 == 0 and num2 == 0:
		break
	elif num1 > num2:
		print("{0} {1}".format(num2, num1))
	else:
		print("{0} {1}".format(num1, num2))

Submission status: Accepted

Solution code:
def main():

    while True:
        [num_a, num_b] = sorted(list(map(int, input().split())))
        if num_a != 0 or num_b != 0:
            print('%d %d' % (num_a, num_b))
        else:
            break


main()

Submission status: Accepted

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

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(x,y)
  else:
    print(y,x)

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 == y == 0:
    break
  print(min(x, y), max(x, y))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_3_C&lang=jp

"""
import sys
from sys import stdin
input = stdin.readline


def main(args):
    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)


if __name__ == '__main__':
    main(sys.argv[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(a)+" "+str(b))
    elif a>b:
        print(str(b)+" "+str(a))
    else:
        print(str(a)+" "+str(b))

Submission status: Accepted

Solution code:
while True:
  line = input()
  if line == '0 0':
    break
  line = line.split()
  if int(line[0]) < int(line[1]):
    print('{} {}'.format(line[0],line[1]))
  else: print('{} {}'.format(line[1], line[0]))

Submission status: Accepted

Solution code:
def sort_num(x, y):
    n = [x, y]
    n.sort()
    print(n[0], n[1])

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

Submission status: Accepted

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

Submission status: Accepted

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

import fileinput
import math

def main():
    while True:
        line = input().strip()
        x, y = map(int, line.split())

        if (x == 0 and y == 0):
            break
        else:
            if (x > y):
                print('%d %d' % (y, x))
            else:
                print('%d %d' % (x, y))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

while True:
    x, y = map(int, sys.stdin.readline().split())
    if (x == 0 )and (y == 0):
        break

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

Submission status: Accepted

Solution code:
w="yjsnpi"
a=[]
output=[]
while (w!="0 0"):
    w=input()
    b=w.split()
    x=int(b[0])
    y=int(b[1])
    if (x>y):
        output.append("{0} {1}".format(y,x))
    else:
        output.append("{0} {1}".format(x,y))
output.remove("0 0")
for k in output:
    print(k)

Submission status: Accepted

Solution code:
import sys
while 1:
    a,b = map(int,sys.stdin.readline().split())
    if a == 0 and b == 0:
        break
    if a < b:
        print (a,b)
    else:
        print (b,a)

Submission status: Accepted

Solution code:
i = 1
while i <= 3000:
    x,y = map(int, input().split())
    if (x == 0 and y == 0) or (x < 0 or 10000 < x) or (y < 0 or 10000 < y):
        break
    result = (str(x) + ' ' + str(y)) if x < y  else (str(y) + ' ' + str(x))
    print(result)
    i += 1

Submission status: Accepted

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
l = []
while True:
    N, M = map(int, input().split())
    if (N == 0 and M == 0):
        break;
    if (N > M):
        N, M = M, N
    l.append([N, M])

for i in l:
    print("{} {}".format(i[0], i[1]))

Submission status: Accepted

Solution code:
class DataSet:
    def __init__(self,x,y):
        self.x = x
        self.y = y

    def swap(self):
        temp = self.y
        self.y = self.x
        self.x = temp

def main():
    data = []
    while 1:
        # ????????????????????????????????????
        n = input().split()
        x = int(n[0])
        y = int(n[1])

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

        data.append(DataSet(x, y))

    length = len(data)
    what_large = length > 3000

    if what_large:
        print("Too Large")
    else:
        for i in range(len(data)):
            d_val = data[i]
            if d_val.x > d_val.y:
                d_val.swap()

            print("{0} {1}".format(d_val.x,d_val.y))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a=[]
while True:
 n=input()
 if n=='0 0':break
 a.append(n)
for s in a:
 x,y=map(int,s.split())
 if x>y:print(f'{y} {x}')
 else:print(s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=[]
while 1:
 n=input()
 if n=='0 0':break
 x,y=map(int,n.split())
 if x>y:print(y,x)
 else:print(n)

Submission status: Accepted

Solution code:
a=[]
while 1:
 n=input()
 if n=='0 0':break
 x,y=map(int,n.split())
 print(y,x) if x>y else print(n)

Submission status: Accepted

Solution code:
a=[]
while 1:
 n=input()
 if n=='0 0':break
 a.append(n)
for s in a:
 x,y=map(int,s.split())
 print(f'{y} {x}') if x>y else print(s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=[]
while 1:
 n=input()
 if n=='0 0':break
 a.append(n)
for s in a:
 x,y=map(int,s.split())
 print(y,x) if x>y else print(s)

Submission status: Accepted

Solution code:
a=[]
while 1:
 n=input()
 if n=='0 0':break
 a.append(n)
for s in a:
 x=sorted(map(int,s.split()))
 print(*x)

Submission status: Accepted

Solution code:
a=[]
while 1:
 n=input()
 if n=='0 0':break
 x=sorted(map(int,n.split()))
 print(*x)

Submission status: Accepted

Solution code:
while 1:
 n = input()
 if n=='0 0':break
 print(*sorted(map(int,n.split())))

Submission status: Accepted

Solution code:
a=[]
while 1:
 n=input()
 if n=='0 0':break
 a.append(n)
for s in a:
 print(*sorted(map(int,s.split())))

Submission status: Accepted

Solution code:
a=[]
while 1:
 n=input()
 if n=='0 0':break
 a.append(n)
for s in a:
 print(*sorted(map(int, s.split())))

Submission status: Accepted

Solution code:
a=[]
import sys
for s in sys.stdin:
 if s=='0 0\n':break
 a.append(s)
for t in a:
 x,y=map(int,t.split())
 print(f'{y} {x}') if x>y else print(t.strip())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=[]
import sys
for s in sys.stdin:
 s=s.strip()
 if s=='0 0':break
 a.append(s)
for t in a:
 print(*sorted(map(int,t.split())))

Submission status: Accepted

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

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:
 a=input()
 if a=='0 0':break
 print(*sorted(map(int,a.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('{0} {1}'.format(x,y))
    else:
        print('{0} {1}'.format(y,x))

Submission status: Accepted

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

Submission status: Accepted

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

    if x > y:
        x, y = y, x

    print('{} {}'.format(x, y))

Submission status: Accepted

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

Submission status: Accepted

Solution code:

import sys

inputs = [i.strip() for i in sys.stdin.readlines()]

for i in inputs:
    n = sorted(map(int, i.split()))
    if n[0] == 0 and n[1] == 0:
        break
    else:
        print(f"{n[0]} {n[1]}")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:
    a, b = sorted([int(i) for i in input().split()])
    if not(a or b):
        break
    print(a,b)

Submission status: Accepted

Solution code:
import sys
for i in sys.stdin.readlines():
        a, b = i.strip().split()
        if a == "0" and b == "0":
                break
 
        if int(a) < int(b):
                print("{} {}".format(a,b))
        else:
                print("{} {}".format(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:
        b,a=a,b
    print(a,b)

Submission status: Accepted

Solution code:
# coding:utf-8
while True:
    array = map(int, raw_input().split())
    if array[0] == 0 and array[1] == 0:
        break
    array.sort()
    print array[0],array[1]

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
for c in sys.stdin:
    a,b=sorted(map(int,c.split()))
    if a==0 and b==0:break
    print(a,b)

Submission status: Accepted

Solution code:
while True:
    instr = input()
    instrSp = instr.split()
    x = int(instrSp[0])
    y = int(instrSp[1])
    if x == 0 and y == 0:
        break
    else:
        if x < y:
            print("{x} {y}".format(x=x, y=y))
        else:
            print("{y} {x}".format(y=y, x=x))

Submission status: Accepted

Solution code:
while True:
    x,y=sorted([int(x) for x in input().split()])
    if (x,y)==(0,0):
        break
    print(x,y)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:
	try:
		line = input()
		if line == '0 0':
			break	
		else:
			a,b = line.split(' ')
			if int(a) > int(b):
				print('{} {}'.format(b,a))
			else:
				print('{} {}'.format(a,b))
	except EOFError:
		break

Submission status: Accepted

Solution code:
while True:
    list = [int(x) for x in input().split( )]
    if list[0] != 0 or list[1] != 0:
        print(' '.join(map(str,sorted(list))))
    else:
        break

Submission status: Accepted

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

Submission status: Accepted

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