
import java.util.*;

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

import java.util.*;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int y = sc.nextInt();
		int num;
		while(true){
			if(x>y){
				num = y;
				y = x;
				x = num;
			}else if(x<y || x == y){
				System.out.println(x+" "+y);
				x = sc.nextInt();
				y = sc.nextInt();
				if(x == 0 && y == 0){
					break;
				}
			}
		}
	}
}