import java.util.Scanner;
class Main{
	
	Scanner sc = new Scanner(System.in);
	int x;
	int y;
	
	void rp3(){
	
		x = sc.nextInt();
		y = sc.nextInt();
		
	
		for(int i=1; (x>0 || y>0); i++){
			if(x>y){
				System.out.println(y+" "+x);
			}else{
				System.out.println(x+" "+y);
			}
			x = sc.nextInt();
			y = sc.nextInt();
			
		}
	}
	
	public static void main(String[]agrs){
			new Main().rp3();
	}
}
	 import java.util.Scanner; Scanner java.util class Main{
	
	Scanner sc = new Scanner(System.in);
	int x;
	int y;
	
	void rp3(){
	
		x = sc.nextInt();
		y = sc.nextInt();
		
	
		for(int i=1; (x>0 || y>0); i++){
			if(x>y){
				System.out.println(y+" "+x);
			}else{
				System.out.println(x+" "+y);
			}
			x = sc.nextInt();
			y = sc.nextInt();
			
		}
	}
	
	public static void main(String[]agrs){
			new Main().rp3();
	}
} Main Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int x; x int y; y void rp3(){
	
		x = sc.nextInt();
		y = sc.nextInt();
		
	
		for(int i=1; (x>0 || y>0); i++){
			if(x>y){
				System.out.println(y+" "+x);
			}else{
				System.out.println(x+" "+y);
			}
			x = sc.nextInt();
			y = sc.nextInt();
			
		}
	} rp3 {
	
		x = sc.nextInt();
		y = sc.nextInt();
		
	
		for(int i=1; (x>0 || y>0); i++){
			if(x>y){
				System.out.println(y+" "+x);
			}else{
				System.out.println(x+" "+y);
			}
			x = sc.nextInt();
			y = sc.nextInt();
			
		}
	} x = sc.nextInt() x sc.nextInt() sc.nextInt sc y = sc.nextInt() y sc.nextInt() sc.nextInt sc for(int i=1; (x>0 || y>0); i++){
			if(x>y){
				System.out.println(y+" "+x);
			}else{
				System.out.println(x+" "+y);
			}
			x = sc.nextInt();
			y = sc.nextInt();
			
		} int i=1; int i=1; i 1 (x>0 || y>0) x>0 x 0 y>0 y 0 i++ i++ i {
			if(x>y){
				System.out.println(y+" "+x);
			}else{
				System.out.println(x+" "+y);
			}
			x = sc.nextInt();
			y = sc.nextInt();
			
		} {
			if(x>y){
				System.out.println(y+" "+x);
			}else{
				System.out.println(x+" "+y);
			}
			x = sc.nextInt();
			y = sc.nextInt();
			
		} if(x>y){
				System.out.println(y+" "+x);
			}else{
				System.out.println(x+" "+y);
			} x>y x y {
				System.out.println(y+" "+x);
			} System.out.println(y+" "+x) System.out.println System.out System System.out y+" "+x y+" "+x y " " x {
				System.out.println(x+" "+y);
			} System.out.println(x+" "+y) System.out.println System.out System System.out x+" "+y x+" "+y x " " y x = sc.nextInt() x sc.nextInt() sc.nextInt sc y = sc.nextInt() y sc.nextInt() sc.nextInt sc public static void main(String[]agrs){
			new Main().rp3();
	} main {
			new Main().rp3();
	} new Main().rp3() new Main().rp3 new Main() String[]agrs agrs
import java.util.Scanner;
class Main{
	
	Scanner sc = new Scanner(System.in);
	int x;
	int y;
	
	void rp3(){
	
		x = sc.nextInt();
		y = sc.nextInt();
		
	
		for(int i=1; (x>0 || y>0); i++){
			if(x>y){
				System.out.println(y+" "+x);
			}else{
				System.out.println(x+" "+y);
			}
			x = sc.nextInt();
			y = sc.nextInt();
			
		}
	}
	
	public static void main(String[]agrs){
			new Main().rp3();
	}
}
	