import java.io.*;  
public class Main {
    public static void main(String[] args) throws IOException {
	                                         
    	
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	String buf = br.readLine();
    String[] x = buf.split(" ",0);

    	int a = Integer.parseInt(x[0]);
    	int b = Integer.parseInt(x[1]);

    	while (a!=0 || b!=0){
    	if ((0 <= a && a <= 10000)&&(0 <= b &&  b <=10000))
    		{
    		if(a>b){
    		int temp = a;
    		    a = b;
    		    b =temp;
    		}
    		System.out.println(a + " " + b); 
    		buf = br.readLine();
    		x = buf.split(" ",0);

    		a = Integer.parseInt(x[0]);
    		b = Integer.parseInt(x[1]);
    	}
    		
    	}
    
	}
} import java.io.*; io.* java public class Main {
    public static void main(String[] args) throws IOException {
	                                         
    	
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	String buf = br.readLine();
    String[] x = buf.split(" ",0);

    	int a = Integer.parseInt(x[0]);
    	int b = Integer.parseInt(x[1]);

    	while (a!=0 || b!=0){
    	if ((0 <= a && a <= 10000)&&(0 <= b &&  b <=10000))
    		{
    		if(a>b){
    		int temp = a;
    		    a = b;
    		    b =temp;
    		}
    		System.out.println(a + " " + b); 
    		buf = br.readLine();
    		x = buf.split(" ",0);

    		a = Integer.parseInt(x[0]);
    		b = Integer.parseInt(x[1]);
    	}
    		
    	}
    
	}
} Main public static void main(String[] args) throws IOException {
	                                         
    	
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	String buf = br.readLine();
    String[] x = buf.split(" ",0);

    	int a = Integer.parseInt(x[0]);
    	int b = Integer.parseInt(x[1]);

    	while (a!=0 || b!=0){
    	if ((0 <= a && a <= 10000)&&(0 <= b &&  b <=10000))
    		{
    		if(a>b){
    		int temp = a;
    		    a = b;
    		    b =temp;
    		}
    		System.out.println(a + " " + b); 
    		buf = br.readLine();
    		x = buf.split(" ",0);

    		a = Integer.parseInt(x[0]);
    		b = Integer.parseInt(x[1]);
    	}
    		
    	}
    
	} main {
	                                         
    	
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	String buf = br.readLine();
    String[] x = buf.split(" ",0);

    	int a = Integer.parseInt(x[0]);
    	int b = Integer.parseInt(x[1]);

    	while (a!=0 || b!=0){
    	if ((0 <= a && a <= 10000)&&(0 <= b &&  b <=10000))
    		{
    		if(a>b){
    		int temp = a;
    		    a = b;
    		    b =temp;
    		}
    		System.out.println(a + " " + b); 
    		buf = br.readLine();
    		x = buf.split(" ",0);

    		a = Integer.parseInt(x[0]);
    		b = Integer.parseInt(x[1]);
    	}
    		
    	}
    
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String buf = br.readLine(); buf br.readLine() br.readLine br String[] x = buf.split(" ",0); x buf.split(" ",0) buf.split buf " " 0 int a = Integer.parseInt(x[0]); a Integer.parseInt(x[0]) Integer.parseInt Integer x[0] x 0 int b = Integer.parseInt(x[1]); b Integer.parseInt(x[1]) Integer.parseInt Integer x[1] x 1 while (a!=0 || b!=0){
    	if ((0 <= a && a <= 10000)&&(0 <= b &&  b <=10000))
    		{
    		if(a>b){
    		int temp = a;
    		    a = b;
    		    b =temp;
    		}
    		System.out.println(a + " " + b); 
    		buf = br.readLine();
    		x = buf.split(" ",0);

    		a = Integer.parseInt(x[0]);
    		b = Integer.parseInt(x[1]);
    	}
    		
    	} a!=0 || b!=0 a!=0 a 0 b!=0 b 0 {
    	if ((0 <= a && a <= 10000)&&(0 <= b &&  b <=10000))
    		{
    		if(a>b){
    		int temp = a;
    		    a = b;
    		    b =temp;
    		}
    		System.out.println(a + " " + b); 
    		buf = br.readLine();
    		x = buf.split(" ",0);

    		a = Integer.parseInt(x[0]);
    		b = Integer.parseInt(x[1]);
    	}
    		
    	} if ((0 <= a && a <= 10000)&&(0 <= b &&  b <=10000))
    		{
    		if(a>b){
    		int temp = a;
    		    a = b;
    		    b =temp;
    		}
    		System.out.println(a + " " + b); 
    		buf = br.readLine();
    		x = buf.split(" ",0);

    		a = Integer.parseInt(x[0]);
    		b = Integer.parseInt(x[1]);
    	} (0 <= a && a <= 10000)&&(0 <= b &&  b <=10000) (0 <= a && a <= 10000) 0 <= a 0 a a <= 10000 a 10000 (0 <= b &&  b <=10000) 0 <= b 0 b b <=10000 b 10000 {
    		if(a>b){
    		int temp = a;
    		    a = b;
    		    b =temp;
    		}
    		System.out.println(a + " " + b); 
    		buf = br.readLine();
    		x = buf.split(" ",0);

    		a = Integer.parseInt(x[0]);
    		b = Integer.parseInt(x[1]);
    	} if(a>b){
    		int temp = a;
    		    a = b;
    		    b =temp;
    		} a>b a b {
    		int temp = a;
    		    a = b;
    		    b =temp;
    		} int temp = a; temp a a = b a b b =temp b temp System.out.println(a + " " + b) System.out.println System.out System System.out a + " " + b a + " " + b a " " b buf = br.readLine() buf br.readLine() br.readLine br x = buf.split(" ",0) x buf.split(" ",0) buf.split buf " " 0 a = Integer.parseInt(x[0]) a Integer.parseInt(x[0]) Integer.parseInt Integer x[0] x 0 b = Integer.parseInt(x[1]) b Integer.parseInt(x[1]) Integer.parseInt Integer x[1] x 1 String[] args args public class Main {
    public static void main(String[] args) throws IOException {
	                                         
    	
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	String buf = br.readLine();
    String[] x = buf.split(" ",0);

    	int a = Integer.parseInt(x[0]);
    	int b = Integer.parseInt(x[1]);

    	while (a!=0 || b!=0){
    	if ((0 <= a && a <= 10000)&&(0 <= b &&  b <=10000))
    		{
    		if(a>b){
    		int temp = a;
    		    a = b;
    		    b =temp;
    		}
    		System.out.println(a + " " + b); 
    		buf = br.readLine();
    		x = buf.split(" ",0);

    		a = Integer.parseInt(x[0]);
    		b = Integer.parseInt(x[1]);
    	}
    		
    	}
    
	}
} public class Main {
    public static void main(String[] args) throws IOException {
	                                         
    	
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	String buf = br.readLine();
    String[] x = buf.split(" ",0);

    	int a = Integer.parseInt(x[0]);
    	int b = Integer.parseInt(x[1]);

    	while (a!=0 || b!=0){
    	if ((0 <= a && a <= 10000)&&(0 <= b &&  b <=10000))
    		{
    		if(a>b){
    		int temp = a;
    		    a = b;
    		    b =temp;
    		}
    		System.out.println(a + " " + b); 
    		buf = br.readLine();
    		x = buf.split(" ",0);

    		a = Integer.parseInt(x[0]);
    		b = Integer.parseInt(x[1]);
    	}
    		
    	}
    
	}
} Main
import java.io.*;  
public class Main {
    public static void main(String[] args) throws IOException {
	                                         
    	
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	String buf = br.readLine();
    String[] x = buf.split(" ",0);

    	int a = Integer.parseInt(x[0]);
    	int b = Integer.parseInt(x[1]);

    	while (a!=0 || b!=0){
    	if ((0 <= a && a <= 10000)&&(0 <= b &&  b <=10000))
    		{
    		if(a>b){
    		int temp = a;
    		    a = b;
    		    b =temp;
    		}
    		System.out.println(a + " " + b); 
    		buf = br.readLine();
    		x = buf.split(" ",0);

    		a = Integer.parseInt(x[0]);
    		b = Integer.parseInt(x[1]);
    	}
    		
    	}
    
	}
}