import java.util.Scanner;
	class Main{
	public void Germany() {
		Scanner sc = new Scanner(System.in);
		int x,y,z;
		x = sc.nextInt();
		y = sc.nextInt();
		while(x != 0 || y != 0){
			if(x > y){
				z = x;
				x = y;
				y = z;
			}else{
				z = x;
				x = y;
				y = z;
				z = y;
				y = x;
				x = z;				
			}
			System.out.println(x + " " + y);
			x = sc.nextInt();
			y = sc.nextInt();
		}
	}
public static void main(String[] args) {
	new Main().Germany();
	}
} import java.util.Scanner; Scanner java.util class Main{
	public void Germany() {
		Scanner sc = new Scanner(System.in);
		int x,y,z;
		x = sc.nextInt();
		y = sc.nextInt();
		while(x != 0 || y != 0){
			if(x > y){
				z = x;
				x = y;
				y = z;
			}else{
				z = x;
				x = y;
				y = z;
				z = y;
				y = x;
				x = z;				
			}
			System.out.println(x + " " + y);
			x = sc.nextInt();
			y = sc.nextInt();
		}
	}
public static void main(String[] args) {
	new Main().Germany();
	}
} Main public void Germany() {
		Scanner sc = new Scanner(System.in);
		int x,y,z;
		x = sc.nextInt();
		y = sc.nextInt();
		while(x != 0 || y != 0){
			if(x > y){
				z = x;
				x = y;
				y = z;
			}else{
				z = x;
				x = y;
				y = z;
				z = y;
				y = x;
				x = z;				
			}
			System.out.println(x + " " + y);
			x = sc.nextInt();
			y = sc.nextInt();
		}
	} Germany {
		Scanner sc = new Scanner(System.in);
		int x,y,z;
		x = sc.nextInt();
		y = sc.nextInt();
		while(x != 0 || y != 0){
			if(x > y){
				z = x;
				x = y;
				y = z;
			}else{
				z = x;
				x = y;
				y = z;
				z = y;
				y = x;
				x = z;				
			}
			System.out.println(x + " " + y);
			x = sc.nextInt();
			y = sc.nextInt();
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int x x y y z; z x = sc.nextInt() x sc.nextInt() sc.nextInt sc y = sc.nextInt() y sc.nextInt() sc.nextInt sc while(x != 0 || y != 0){
			if(x > y){
				z = x;
				x = y;
				y = z;
			}else{
				z = x;
				x = y;
				y = z;
				z = y;
				y = x;
				x = z;				
			}
			System.out.println(x + " " + y);
			x = sc.nextInt();
			y = sc.nextInt();
		} x != 0 || y != 0 x != 0 x 0 y != 0 y 0 {
			if(x > y){
				z = x;
				x = y;
				y = z;
			}else{
				z = x;
				x = y;
				y = z;
				z = y;
				y = x;
				x = z;				
			}
			System.out.println(x + " " + y);
			x = sc.nextInt();
			y = sc.nextInt();
		} if(x > y){
				z = x;
				x = y;
				y = z;
			}else{
				z = x;
				x = y;
				y = z;
				z = y;
				y = x;
				x = z;				
			} x > y x y {
				z = x;
				x = y;
				y = z;
			} z = x z x x = y x y y = z y z {
				z = x;
				x = y;
				y = z;
				z = y;
				y = x;
				x = z;				
			} z = x z x x = y x y y = z y z z = y z y y = x y x x = z x z 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[] args) {
	new Main().Germany();
	} main {
	new Main().Germany();
	} new Main().Germany() new Main().Germany new Main() String[] args args
import java.util.Scanner;
	class Main{
	public void Germany() {
		Scanner sc = new Scanner(System.in);
		int x,y,z;
		x = sc.nextInt();
		y = sc.nextInt();
		while(x != 0 || y != 0){
			if(x > y){
				z = x;
				x = y;
				y = z;
			}else{
				z = x;
				x = y;
				y = z;
				z = y;
				y = x;
				x = z;				
			}
			System.out.println(x + " " + y);
			x = sc.nextInt();
			y = sc.nextInt();
		}
	}
public static void main(String[] args) {
	new Main().Germany();
	}
}