import java.io.*;

class Main{
	
	public static void main(String[] args)throws IOException{
		
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder result = new StringBuilder();
		
		while(true){
			String tmp = input.readLine();
			String[] strInput = tmp.split(" ");
			int x = Integer.parseInt(strInput[0]);
			int y = Integer.parseInt(strInput[1]);
			
			if(x == 0 && y == 0){
				break;
			}
			
			if(x > y){
			    int temp = x;
			    x = y;
			    y = temp;
			   
			}

			result.append(x + " " + y + "\n");
		}
	       
		System.out.print(result);
		
	}
	
} import java.io.*; io.* java class Main{
	
	public static void main(String[] args)throws IOException{
		
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder result = new StringBuilder();
		
		while(true){
			String tmp = input.readLine();
			String[] strInput = tmp.split(" ");
			int x = Integer.parseInt(strInput[0]);
			int y = Integer.parseInt(strInput[1]);
			
			if(x == 0 && y == 0){
				break;
			}
			
			if(x > y){
			    int temp = x;
			    x = y;
			    y = temp;
			   
			}

			result.append(x + " " + y + "\n");
		}
	       
		System.out.print(result);
		
	}
	
} Main public static void main(String[] args)throws IOException{
		
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder result = new StringBuilder();
		
		while(true){
			String tmp = input.readLine();
			String[] strInput = tmp.split(" ");
			int x = Integer.parseInt(strInput[0]);
			int y = Integer.parseInt(strInput[1]);
			
			if(x == 0 && y == 0){
				break;
			}
			
			if(x > y){
			    int temp = x;
			    x = y;
			    y = temp;
			   
			}

			result.append(x + " " + y + "\n");
		}
	       
		System.out.print(result);
		
	} main {
		
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder result = new StringBuilder();
		
		while(true){
			String tmp = input.readLine();
			String[] strInput = tmp.split(" ");
			int x = Integer.parseInt(strInput[0]);
			int y = Integer.parseInt(strInput[1]);
			
			if(x == 0 && y == 0){
				break;
			}
			
			if(x > y){
			    int temp = x;
			    x = y;
			    y = temp;
			   
			}

			result.append(x + " " + y + "\n");
		}
	       
		System.out.print(result);
		
	} BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); input new BufferedReader(new InputStreamReader(System.in)) StringBuilder result = new StringBuilder(); result new StringBuilder() while(true){
			String tmp = input.readLine();
			String[] strInput = tmp.split(" ");
			int x = Integer.parseInt(strInput[0]);
			int y = Integer.parseInt(strInput[1]);
			
			if(x == 0 && y == 0){
				break;
			}
			
			if(x > y){
			    int temp = x;
			    x = y;
			    y = temp;
			   
			}

			result.append(x + " " + y + "\n");
		} true {
			String tmp = input.readLine();
			String[] strInput = tmp.split(" ");
			int x = Integer.parseInt(strInput[0]);
			int y = Integer.parseInt(strInput[1]);
			
			if(x == 0 && y == 0){
				break;
			}
			
			if(x > y){
			    int temp = x;
			    x = y;
			    y = temp;
			   
			}

			result.append(x + " " + y + "\n");
		} String tmp = input.readLine(); tmp input.readLine() input.readLine input String[] strInput = tmp.split(" "); strInput tmp.split(" ") tmp.split tmp " " int x = Integer.parseInt(strInput[0]); x Integer.parseInt(strInput[0]) Integer.parseInt Integer strInput[0] strInput 0 int y = Integer.parseInt(strInput[1]); y Integer.parseInt(strInput[1]) Integer.parseInt Integer strInput[1] strInput 1 if(x == 0 && y == 0){
				break;
			} x == 0 && y == 0 x == 0 x 0 y == 0 y 0 {
				break;
			} break; if(x > y){
			    int temp = x;
			    x = y;
			    y = temp;
			   
			} x > y x y {
			    int temp = x;
			    x = y;
			    y = temp;
			   
			} int temp = x; temp x x = y x y y = temp y temp result.append(x + " " + y + "\n") result.append result x + " " + y + "\n" y x + " " + y + "\n" x " " y "\n" System.out.print(result) System.out.print System.out System System.out result String[] args args
import java.io.*;

class Main{
	
	public static void main(String[] args)throws IOException{
		
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder result = new StringBuilder();
		
		while(true){
			String tmp = input.readLine();
			String[] strInput = tmp.split(" ");
			int x = Integer.parseInt(strInput[0]);
			int y = Integer.parseInt(strInput[1]);
			
			if(x == 0 && y == 0){
				break;
			}
			
			if(x > y){
			    int temp = x;
			    x = y;
			    y = temp;
			   
			}

			result.append(x + " " + y + "\n");
		}
	       
		System.out.print(result);
		
	}
	
}