import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		
		Scanner sc = new Scanner(System.in);
		int x=Integer.parseInt(sc.next());
		int y=Integer.parseInt(sc.next());
		while(x!=0 || y!=0){
			if(x<y) System.out.println(x+" "+y);
			else System.out.println(y+" "+x);
			x=Integer.parseInt(sc.next());
			y=Integer.parseInt(sc.next());
		}

	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		
		Scanner sc = new Scanner(System.in);
		int x=Integer.parseInt(sc.next());
		int y=Integer.parseInt(sc.next());
		while(x!=0 || y!=0){
			if(x<y) System.out.println(x+" "+y);
			else System.out.println(y+" "+x);
			x=Integer.parseInt(sc.next());
			y=Integer.parseInt(sc.next());
		}

	}

} Main public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		
		Scanner sc = new Scanner(System.in);
		int x=Integer.parseInt(sc.next());
		int y=Integer.parseInt(sc.next());
		while(x!=0 || y!=0){
			if(x<y) System.out.println(x+" "+y);
			else System.out.println(y+" "+x);
			x=Integer.parseInt(sc.next());
			y=Integer.parseInt(sc.next());
		}

	} main {
		// TODO ?????????????????????????????????????????????
		
		Scanner sc = new Scanner(System.in);
		int x=Integer.parseInt(sc.next());
		int y=Integer.parseInt(sc.next());
		while(x!=0 || y!=0){
			if(x<y) System.out.println(x+" "+y);
			else System.out.println(y+" "+x);
			x=Integer.parseInt(sc.next());
			y=Integer.parseInt(sc.next());
		}

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int x=Integer.parseInt(sc.next()); x Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int y=Integer.parseInt(sc.next()); y Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc while(x!=0 || y!=0){
			if(x<y) System.out.println(x+" "+y);
			else System.out.println(y+" "+x);
			x=Integer.parseInt(sc.next());
			y=Integer.parseInt(sc.next());
		} x!=0 || y!=0 x!=0 x 0 y!=0 y 0 {
			if(x<y) System.out.println(x+" "+y);
			else System.out.println(y+" "+x);
			x=Integer.parseInt(sc.next());
			y=Integer.parseInt(sc.next());
		} if(x<y) System.out.println(x+" "+y);
			else System.out.println(y+" "+x); x<y x y System.out.println(x+" "+y) System.out.println System.out System System.out x+" "+y x+" "+y x " " y System.out.println(y+" "+x) System.out.println System.out System System.out y+" "+x y+" "+x y " " x x=Integer.parseInt(sc.next()) x Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc y=Integer.parseInt(sc.next()) y Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc String[] args args public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		
		Scanner sc = new Scanner(System.in);
		int x=Integer.parseInt(sc.next());
		int y=Integer.parseInt(sc.next());
		while(x!=0 || y!=0){
			if(x<y) System.out.println(x+" "+y);
			else System.out.println(y+" "+x);
			x=Integer.parseInt(sc.next());
			y=Integer.parseInt(sc.next());
		}

	}

} public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		
		Scanner sc = new Scanner(System.in);
		int x=Integer.parseInt(sc.next());
		int y=Integer.parseInt(sc.next());
		while(x!=0 || y!=0){
			if(x<y) System.out.println(x+" "+y);
			else System.out.println(y+" "+x);
			x=Integer.parseInt(sc.next());
			y=Integer.parseInt(sc.next());
		}

	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		
		Scanner sc = new Scanner(System.in);
		int x=Integer.parseInt(sc.next());
		int y=Integer.parseInt(sc.next());
		while(x!=0 || y!=0){
			if(x<y) System.out.println(x+" "+y);
			else System.out.println(y+" "+x);
			x=Integer.parseInt(sc.next());
			y=Integer.parseInt(sc.next());
		}

	}

}