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:
while 1:
	x, y = map(int, raw_input().split())
	if x == 0 and y == 0:
		break
	if x > y:
		print "%d %d" % (y, x)
	else:
		print "%d %d" % (x, y)

Submission status: Accepted

Solution code:
def solve(a, b):
    if b < a:
        a, b = b, a
    print(a, b)

if __name__ == '__main__':
    while True:
        a, b = [int(i) for i in input().split()]
        if a == 0 and b == 0: break
        solve(a, b)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

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:
#coding:utf-8
#1_3_C 2015.3.24
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))

Submission status: Accepted

Solution code:
#coding:utf-8
#1_3_C 2015.3.24
while True:
    x,y = map(int,input().split())
    if (x,y) == (0,0):
        break
    elif x > y:
        x,y = y,x
    print('{} {}'.format(x,y))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:
	[a,b]=raw_input().split()
	x=int(a)
	y=int(b)
	if x==y==0:break
	if x<=y:
		print a,b
	else:
		print b,a

Submission status: Accepted

Solution code:
import sys
for d in sys.stdin:
    x, y = map(int, d.split())
    if (x, y) == (0, 0): break
    print("{0} {1}".format(min(x, y), max(x, y)))

Submission status: Accepted

Solution code:
import sys

while True:
	xy=sys.stdin.readline()
	nums=xy.split( ' ' )
	for i in range( len( nums) ):
		nums[i] = int( nums[i] )
	if nums[0] == 0 and nums[1] == 0:
		break
	else:
		if nums[1] < nums[0]:
			t=nums[0]
			nums[0]=nums[1]
			nums[1]=t
		print( "{} {}".format( nums[0], nums[1] ) )

Submission status: Accepted

Solution code:
import sys

while True:
	nums = [ int( val ) for val in sys.stdin.readline().split( " " ) ]
	if 0 == nums[0] and 0 == nums[1]:
		break
	else:
		nums.sort()
		print( "{} {}".format( nums[0], nums[1] ) )

Submission status: Accepted

Solution code:
import sys

while True:
	nums = sorted( [ int( val ) for val in sys.stdin.readline().split( " " ) ] )
	if 0 == nums[0] and 0 == nums[1]:
		break
	else:
		print( "{} {}".format( nums[0], nums[1] ) )

Submission status: Accepted

Solution code:
while 1:
	x, y = map(int, raw_input().split())
	if x == y == 0:
		break
	else:
		if x < y:
			print "%d %d" % (x, y)
		else:
			print "%d %d" % (y, x)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:
	ia=[int(i) for i in input().split(" ")]
	if ia[0]==ia[1]==0:
		break
	print(" ".join([str(i) for i in sorted(ia)]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding:UTF-8

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

Submission status: Accepted

Solution code:
def get_input():
  lst = []
  pair = [int(n) for n in input().split(" ")]
  while pair != [0, 0]:
    lst.append(pair)
    pair = [int(n) for n in input().split(" ")]
  return lst

def to_str(lst):
  return [str(n) for n in lst]

lst = get_input()
for pair in lst:
  print(' '.join(to_str(sorted(pair))))

Submission status: Accepted

Solution code:
def main():

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

		else:
			if x >  y:
				print('{0} {1}'.format(y, x))
			if x <= y:
				print('{0} {1}'.format(x, y))

	    


if __name__=="__main__":
	main()

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:
# coding=utf-8

while True:
    x, y = map(int, raw_input().rstrip().split())
    if x + y:
        print '{} {}'.format(*sorted([x, y]))
    else:
        break

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    i = 0
    while True:
        v = map( int, raw_input().split())
        if v[0] == 0:
            if v[1] == 0:
                break
        i += 1
        if v[0] > v[1]:
            print "{0} {1}".format(v[1],v[0])
        else:
            print "{0} {1}".format(v[0],v[1])

Submission status: Accepted

Solution code:
while 1:
  x, y = map(int, raw_input().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:
while 1:
    x, y = map(int, input().split())
    if x == y == 0:
        break
    print(min(x, y), max(x, y))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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:
ans = []
while True:
  arr = map(int, raw_input().split())
  if arr[0] == 0 and arr[1] == 0:
    break
  else:
    arr.sort()
    ans.append(arr)

for x in ans:
  print(" ".join(map(str, x)))

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


n = 0
i = 0
while (n == 0): 

	i = i + 1

	data = map(int, raw_input().split())
	x = data[0]
	y = data[1]

	if(x == 0 and y == 0):
		break
	else:
		if x > y:
			print "%s %s" % (y, x)
		else:
			print "%s %s" % (x, y)

Submission status: Accepted

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

Submission status: Accepted

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

    if x < y:
        print(x, y)
    elif x > y:
        print(y, x)
    elif x == y:
        if x == 0 and 0 == y:
            break
        print(x, y)

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:
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:
#! /usr/bin/env python
# -*- coding: utf-8 -*-

l = []
while True:
    values = map(int, raw_input().split())
    if values[0] == 0 and values[1] == 0:
        break
    else:
        l.append(values)

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

Submission status: Accepted

Solution code:
list = []
while True:
  line = raw_input().split(" ")
  if line[0] == "0" and line[1] == "0":
    break
  line = map(int, line)
  #print line
  if line[0] > line[1]:
    temp = line[0]
    line[0] = line[1]
    line[1] = temp
  print " ".join(map(str, line))

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:
import sys
 
#ff = open("test.txt", "r")
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)
 
exit()

Submission status: Accepted

Solution code:
import sys
 
def main():
    for line in iter(sys.stdin.readline, ""):
        a = line.rstrip("\n").split(" ")
        b = []
        b.append(int(a[0]))
        b.append(int(a[1]))
        if (b[0] == 0 and b[1] == 0):
            return
 
        print(str(min(b)) + " " + str(max(b)))
      
if __name__ == "__main__":
    main()

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:
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:
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:
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:
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:
while 1:
	a, b = [int(x) for x 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:
(lambda *_: None)(
    *map(print,
         map('{0[0]} {0[1]}'.format,
             map(lambda ss: sorted(ss, key=int),
                 map(str.split,
                     iter(input, '0 0'))))))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

for i in sys.stdin:
    i = i.split(" ")
    x, y = int(i[0]), int(i[1])
    if x == y == 0:
        break
    elif x <= y:
        print("{0} {1}".format(x, y))
    else:
        print("{0} {1}".format(y, x))

Submission status: Accepted

Solution code:
a = []
while True:
    b = map(int, raw_input().split())
    if b == [0, 0]:
         break
    a.append(b)
for list in a:
    x = list[0] 
    y = list[1]
    if x > y:
         x, y = y, x
    print x, y

Submission status: Accepted

Solution code:
i = 0
a = []
while True:
    x = raw_input().split()
    if int(x[0]) == 0 and int(x[1]) == 0:
        break
    else:
        if int(x[0])>int(x[1]):
            x[0],x[1]=x[1],x[0]
        a.append(x)


for j in range(len(a)):
    print " ".join(a[j])

Submission status: Accepted

Solution code:
while True:
    n = map(int, raw_input().split())
    if (n[0] == 0) & (n[1] == 0):
        break
    print "%d %d" % (min(n), max(n))

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:
flag = 1
while flag:
    numbers = []
    n = raw_input()
    numbers = n.split(" ")
    x = int(numbers[0])
    y = int(numbers[1])
    if x == 0 and y == 0:
    	flag = 0
    	continue
    if x >= y:
    	x, y = y, x
    print x, y

Submission status: Accepted

Solution code:
while True :
	a = raw_input().split()
	x = int(a[0])
	y = int(a[1])
	if x == 0 and y == 0 :
		break
	elif x < y :
		print u"%d %d" % (x, y)
	else :
		print u"%d %d" % (y, x)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:
    a, b = map(int,raw_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:
while 1:
    (a,b) = map(int,raw_input().split())
    if a==0 and b==0 : break;
    print min(a,b),max(a,b)

Submission status: Accepted

Solution code:
# encoding:utf-8
while True:
	input = map(int, raw_input().split())
	x, y = input
	if x == y == 0:
		break
	input.sort()
	print(" ".join(map(str, input)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#! /usr/bin/env python
# -*- coding: utf-8 -*-

x_list = []
y_list = []
while True:
    x, y = map(int, raw_input().split())
    if x == 0 and y == 0:
        break
    else:
        x_list.append(x)
        y_list.append(y)

for i, num in enumerate(x_list):
    if x_list[i] == y_list[i]:
        print("%d %d") % (x_list[i], y_list[i])
    elif x_list[i] < y_list[i]:
        print("%d %d") % (x_list[i], y_list[i])
    else:
        print("%d %d") % (y_list[i], x_list[i])

Submission status: Accepted

Solution code:
while 1:
 x,y=sorted(map(int,raw_input().split()))
 if y<1:break
 print x,y

Submission status: Accepted

Solution code:
while True:
	a,b=map(int, raw_input().split())
	if a==0 and b==0:
		break
	print "{0} {1}".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(a, b)
	elif b < a:
		print(b, a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l = []
while True:
  s = [int(i) for i in input().split()]
  if s == [0,0]:
    break
  else:
    s.sort()
    l.append(str(s[0])+' '+str(s[1]))
for i in l:
  print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
nums = []
while True:
    in_line = raw_input().split()
    if int(in_line[0]) == 0 and int(in_line[1]) == 0:
        break
    nums.append([int(in_line[0]),int(in_line[1])])
for n in nums:
    n.sort()
    print n[0],
    print n[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(b, a)
  else:
    print(a, b)

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)
 
exit()

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

for i,ws in enumerate(sys.stdin,1):
    list = sorted(map(int, ws[:-1].split()))

    if list[0] == 0 and list[1] == 0:
        break

    print(' '.join(map(str,list)))

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
    elif a < b :
        print(a, b)
    else :
        print(b, a)

Submission status: Accepted

Solution code:
import sys

for in_str in sys.stdin:
#    comp_list = list(map(int, in_str.split(" ")))
    a, b = map(int, in_str.split())
    #a = comp_list[0]
    #b = comp_list[1]
    if (a == 0) & (b == 0) : break
    elif a < b :
        print(a, b)
    else :
        print(b, a)

Submission status: Accepted

Solution code:
import sys

for in_str in sys.stdin:
    comp_list = list(map(int, in_str.split(" ")))
#    a, b = map(int, in_str.split())
    a = comp_list[0]
    b = comp_list[1]
    if (a == 0) & (b == 0) : break
    elif a < b :
        print(a, b)
    else :
        print(b, a)

Submission status: Accepted

Solution code:
import sys

for in_str in sys.stdin:
    comp_list = list(map(int, in_str.split(" ")))
#    a, b = map(int, in_str.split())
    a = comp_list[0]
    b = comp_list[1]
    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:
        print(str(y)+" "+str(x))
    else:
        print(str(x)+" "+str(y))

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(str(x) + " " + str(y))
	else :
		print(str(y) + " " + str(x))

Submission status: Accepted

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

Submission status: Accepted

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

x = []
y = []

while ( 1 ):
    
    temp_x, temp_y = map(int, input().split() )
    
    if (temp_x == 0 and temp_y == 0):
        break

    if (temp_y < temp_x):
        temp_x, temp_y = temp_y, temp_x

    x.append(temp_x)
    y.append(temp_y)

for (i,j) in zip(x,y):
    print(i,j)

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(str(a) + " " + str(b))
	else :
		print(str(b) + " " + str(a))

Submission status: Accepted

Solution code:
while 1:
    a,b = sorted(map(int, raw_input().split(' ')))
    if a or b:
        print a, b
    else:
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:
    t=[int(i) for i in input().split()]
    if t == [0,0]:
        break
    print("%d %d"%(min(t),max(t)))

Submission status: Accepted

Solution code:
i=0
while 1:
    i+=1
    x,y=map(int, raw_input().split())

    if x==0 and y==0:
        break
    print min(x,y),max(x,y)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:



while 1:
  x, y = map(int, raw_input().split())
  if x == y == 0:
     break


  if x < y:
     print '%d %d' %(x, y)
  elif x > y :
     print '%d %d' %(y, x)
  elif x == y:
     print '%d %d' %(x, y)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while 1:
 x, y = map(int, raw_input().split())
 if x == y == 0:
  break
 else:
  if x < y:
   print "%d %d" % (x, y)
  else:
   print "%d %d" % (y, x)

Submission status: Accepted

Solution code:
while 1:
   x, y = map(int, raw_input().split())
   if x == 0 and y == 0:
      break
   else:
      if x > y:
         print '%s %s' % (y,x)
      else:
         print '%s %s' % (x,y)

Submission status: Accepted

Solution code:
while 1:
   x, y = map(int, raw_input().split())
   if x == 0 and y == 0:
      break
   elif x > y:
      print '%s %s' % (y,x)
   else:
      print '%s %s' % (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 "%d %d" %(x, y)
  else:
    print "%d %d" %(y, x)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
while (1):
  x,y = map(int,raw_input().split())
  if x == 0 and y ==0:
    break
  print "%d %d" %(min(x,y), max(x,y))

Submission status: Accepted

Solution code:
data = [int(x) for x in input().split()]
while(not(data[0] == 0 and data[1] == 0)):
    data.sort()
    print(data[0], data[1])
    data = [int(x) for x in input().split()]

Submission status: Accepted

Solution code:
n = -100, -100

while n[0] != 0 or n[1] != 0:
   n = map( int, raw_input().split())
   if n[0] != 0 or n[1] != 0:
      print min(n[0],n[1]),max(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 x >= y:
      print '%s %s' % (y, x)
   else:
      print '%s %s' % (x, y)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while 1:
  a = map(int, raw_input().split())
  if a[0]==0 and a[1]==0:
    break
  else:
    a.sort()
    print '%d %d' % (a[0], a[1])

Submission status: Accepted

Solution code:

while True:
    
    k=map(int,raw_input().split())

    if k[0]==0 and k[1]==0:
        break
    elif k[0]>k[1]:
        print k[1],k[0]
    else:
        print k[0],k[1]

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while 1:
  x, y = map(int, raw_input().split())
  if x == 0 and y == 0:
    break
  else:
    if x > y:
      temp = x
      x = y
      y = temp
  print '{0} {1}'.format(x, y)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while 1:
   x,y = map(int, raw_input().split())
   if x == 0 and y == 0:
      break
   if y >= x:
      print '%s %s' % (x, y)
   else:
      print '%s %s' % (y, x)

Submission status: Accepted

Solution code:
x = []
y = []
i = 0

while True:
  a, b = map(int, input().split())
  if b < a:
    stock = a
    a = b
    b = stock
  x.append(a)
  y.append(b)
  if x[i] == 0 and y[i] == 0:
    break
  i += 1

for j in range(i):
  print(str(x[j]), str(y[j]))

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

Submission status: Accepted

Solution code:
while 1:
  x, y = map(int, raw_input().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:
while True:
    Num = map(int, raw_input().split())
    a = Num[0]
    b = Num[1]
    Max = max(a, b)
    Min = min(a, b)

    if a == 0 and b == 0:
        break
    else:
        print "%d %d" %(Min, Max)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

		else :
			print(str(b) +" "+ str(a))

Submission status: Accepted

Solution code:

n = 0
i = 0
while (n == 0): 
 
    i = i + 1
 
    data = map(int, raw_input().split())
    x = data[0]
    y = data[1]
 
    if(x == 0 and y == 0):
        break
    else:
        if x > y:
            print "%s %s" % (y, x)
        else:
            print "%s %s" % (x, y)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l = []
while True:
	s = [int(i) for i in input().split()]
	if s == [0, 0]:
		break
	else:
		s.sort()
		l.append(str(s[0]) + ' ' + str(s[1]))
for i in l:
	print(i)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding: UTF-8

while 1:
    i = map(int,raw_input().split())

    i.sort()
    x = i[0]
    y = i[1]

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

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 
while True:
	x,y = map(int,sys.stdin.readline().split())
	if (x==0) & (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) & (y==0):
		break
	else:
		if x>y:
			print(y,x)
		else:
			print(x,y)

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:
        print(b,a)

Submission status: Accepted

Solution code:
x=[0]*100000
y=[0]*100000
ct=-1
while True:
    ct+=1
    x[ct],y[ct]=map(int,raw_input().split())
    if x[ct]==y[ct]==0:
        break
    else:
        continue
for i in xrange(ct):
    if x[i]>=y[i]:
        print y[i],x[i]
    else:
        print x[i],y[i]

Submission status: Accepted

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

Submission status: Accepted

Solution code:
for x, y in ((int(i) for i in j.split()) for j in iter(input, "0 0")):
  print(y, x) if x > y else print(x, y)

Submission status: Accepted

Solution code:
#coding:utf-8

wh = 1
wh2 = 2
L = []
while wh < wh2:
    x, y = map(int, raw_input(). split())
    if x == 0 and y == 0:
        break
    else:
        L.append(x)
        L.append(y)


i = 0
while i < len(L):
    a = L[i]
    b = L[i + 1]
    if a < b:
        print(str(a) + " " + str(b))
    else:
        print(str(b) + " " + str(a))
    i += 2

Submission status: Accepted

Solution code:
while True:
 a=map(int,raw_input().split())
 if a==[0,0]:
  break
 if a[0]>a[1]:print(str(a[1])+" "+str(a[0]))
 else: print(str(a[0])+" "+str(a[1]))

Submission status: Accepted

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

    if a ==0 and b==0 :
        break
    else:
        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:
while True:
	n = map(int,raw_input().split(' '))
	if n[0] == 0 and n[1] == 0:
		break
	n.sort()
	x = n[0]
	y = n[1]
	print x,y

Submission status: Accepted

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

Submission status: Accepted

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

while True:
    x, y = map(int, raw_input().split())
    if x+y:
        if x < y:
            print "%d %d" %(x, y)
        else:
            print "%d %d" %(y, x)
    else:
        break;

Submission status: Accepted

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

Submission status: Accepted

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