import java.util.Scanner;

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

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