import java.util.Scanner;

public class Main{
    public static void main(String[] args){
	Scanner stdin = new Scanner(System.in);
	int x = stdin.nextInt();
	int y = stdin.nextInt();
        int w = 0;
	if(y<x){
	    w = y;
	    y = x;
	    x = w;
	}
	while(x!=0 || y!=0){
	    System.out.println(x+" "+y);
	    x = stdin.nextInt();
	    y = stdin.nextInt();
	    if(y<x){
		w = y;
		y = x;
		x = w;
	    }
	}
    }
}

	 import java.util.Scanner; Scanner java.util public class Main{
    public static void main(String[] args){
	Scanner stdin = new Scanner(System.in);
	int x = stdin.nextInt();
	int y = stdin.nextInt();
        int w = 0;
	if(y<x){
	    w = y;
	    y = x;
	    x = w;
	}
	while(x!=0 || y!=0){
	    System.out.println(x+" "+y);
	    x = stdin.nextInt();
	    y = stdin.nextInt();
	    if(y<x){
		w = y;
		y = x;
		x = w;
	    }
	}
    }
} Main public static void main(String[] args){
	Scanner stdin = new Scanner(System.in);
	int x = stdin.nextInt();
	int y = stdin.nextInt();
        int w = 0;
	if(y<x){
	    w = y;
	    y = x;
	    x = w;
	}
	while(x!=0 || y!=0){
	    System.out.println(x+" "+y);
	    x = stdin.nextInt();
	    y = stdin.nextInt();
	    if(y<x){
		w = y;
		y = x;
		x = w;
	    }
	}
    } main {
	Scanner stdin = new Scanner(System.in);
	int x = stdin.nextInt();
	int y = stdin.nextInt();
        int w = 0;
	if(y<x){
	    w = y;
	    y = x;
	    x = w;
	}
	while(x!=0 || y!=0){
	    System.out.println(x+" "+y);
	    x = stdin.nextInt();
	    y = stdin.nextInt();
	    if(y<x){
		w = y;
		y = x;
		x = w;
	    }
	}
    } Scanner stdin = new Scanner(System.in); stdin new Scanner(System.in) int x = stdin.nextInt(); x stdin.nextInt() stdin.nextInt stdin int y = stdin.nextInt(); y stdin.nextInt() stdin.nextInt stdin int w = 0; w 0 if(y<x){
	    w = y;
	    y = x;
	    x = w;
	} y<x y x {
	    w = y;
	    y = x;
	    x = w;
	} w = y w y y = x y x x = w x w while(x!=0 || y!=0){
	    System.out.println(x+" "+y);
	    x = stdin.nextInt();
	    y = stdin.nextInt();
	    if(y<x){
		w = y;
		y = x;
		x = w;
	    }
	} x!=0 || y!=0 x!=0 x 0 y!=0 y 0 {
	    System.out.println(x+" "+y);
	    x = stdin.nextInt();
	    y = stdin.nextInt();
	    if(y<x){
		w = y;
		y = x;
		x = w;
	    }
	} System.out.println(x+" "+y) System.out.println System.out System System.out x+" "+y x+" "+y x " " y x = stdin.nextInt() x stdin.nextInt() stdin.nextInt stdin y = stdin.nextInt() y stdin.nextInt() stdin.nextInt stdin if(y<x){
		w = y;
		y = x;
		x = w;
	    } y<x y x {
		w = y;
		y = x;
		x = w;
	    } w = y w y y = x y x x = w x w String[] args args public class Main{
    public static void main(String[] args){
	Scanner stdin = new Scanner(System.in);
	int x = stdin.nextInt();
	int y = stdin.nextInt();
        int w = 0;
	if(y<x){
	    w = y;
	    y = x;
	    x = w;
	}
	while(x!=0 || y!=0){
	    System.out.println(x+" "+y);
	    x = stdin.nextInt();
	    y = stdin.nextInt();
	    if(y<x){
		w = y;
		y = x;
		x = w;
	    }
	}
    }
} public class Main{
    public static void main(String[] args){
	Scanner stdin = new Scanner(System.in);
	int x = stdin.nextInt();
	int y = stdin.nextInt();
        int w = 0;
	if(y<x){
	    w = y;
	    y = x;
	    x = w;
	}
	while(x!=0 || y!=0){
	    System.out.println(x+" "+y);
	    x = stdin.nextInt();
	    y = stdin.nextInt();
	    if(y<x){
		w = y;
		y = x;
		x = w;
	    }
	}
    }
} Main
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
	Scanner stdin = new Scanner(System.in);
	int x = stdin.nextInt();
	int y = stdin.nextInt();
        int w = 0;
	if(y<x){
	    w = y;
	    y = x;
	    x = w;
	}
	while(x!=0 || y!=0){
	    System.out.println(x+" "+y);
	    x = stdin.nextInt();
	    y = stdin.nextInt();
	    if(y<x){
		w = y;
		y = x;
		x = w;
	    }
	}
    }
}

	