
import java.util.*;

public class Main {
	public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		
		int x,y;
		List<Integer> list = new ArrayList<Integer>();
		
		boolean flg1,flg2;
		flg1 =false;
		flg2 = false;
		
		//??????0??§????????????
		while(true){
			x = scan.nextInt();
			y = scan.nextInt();
			//x???0?????´??????true?????????
			if (x == 0){flg1= true;}
			//y???0?????´??????true?????????
			if (y == 0){flg2 = true;}
			//x??¨y???0?????´????????????????????????
			if ((flg1 == true) & (flg2 == true)){break;}
			
			//????????????????????????????????????????????????????????????
			list.add(x);
			list.add(y);
			
			Collections.sort(list);
			
			sb.append(list.get(0));
			sb.append(" ");
			sb.append(list.get(1));
			sb.append("\n");
			
			//???????????????????????????
			list.clear();
			
			//x??¨y????????????????????????0?????´????????????????¶??¶????????????????flg???false?????????
			flg1 = false;
			flg2 = false;
			
		}
		
		System.out.print(new String(sb));
		
		
	}
} import java.util.*; util.* java public class Main {
	public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		
		int x,y;
		List<Integer> list = new ArrayList<Integer>();
		
		boolean flg1,flg2;
		flg1 =false;
		flg2 = false;
		
		//??????0??§????????????
		while(true){
			x = scan.nextInt();
			y = scan.nextInt();
			//x???0?????´??????true?????????
			if (x == 0){flg1= true;}
			//y???0?????´??????true?????????
			if (y == 0){flg2 = true;}
			//x??¨y???0?????´????????????????????????
			if ((flg1 == true) & (flg2 == true)){break;}
			
			//????????????????????????????????????????????????????????????
			list.add(x);
			list.add(y);
			
			Collections.sort(list);
			
			sb.append(list.get(0));
			sb.append(" ");
			sb.append(list.get(1));
			sb.append("\n");
			
			//???????????????????????????
			list.clear();
			
			//x??¨y????????????????????????0?????´????????????????¶??¶????????????????flg???false?????????
			flg1 = false;
			flg2 = false;
			
		}
		
		System.out.print(new String(sb));
		
		
	}
} Main public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		
		int x,y;
		List<Integer> list = new ArrayList<Integer>();
		
		boolean flg1,flg2;
		flg1 =false;
		flg2 = false;
		
		//??????0??§????????????
		while(true){
			x = scan.nextInt();
			y = scan.nextInt();
			//x???0?????´??????true?????????
			if (x == 0){flg1= true;}
			//y???0?????´??????true?????????
			if (y == 0){flg2 = true;}
			//x??¨y???0?????´????????????????????????
			if ((flg1 == true) & (flg2 == true)){break;}
			
			//????????????????????????????????????????????????????????????
			list.add(x);
			list.add(y);
			
			Collections.sort(list);
			
			sb.append(list.get(0));
			sb.append(" ");
			sb.append(list.get(1));
			sb.append("\n");
			
			//???????????????????????????
			list.clear();
			
			//x??¨y????????????????????????0?????´????????????????¶??¶????????????????flg???false?????????
			flg1 = false;
			flg2 = false;
			
		}
		
		System.out.print(new String(sb));
		
		
	} main {
		Scanner scan = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		
		int x,y;
		List<Integer> list = new ArrayList<Integer>();
		
		boolean flg1,flg2;
		flg1 =false;
		flg2 = false;
		
		//??????0??§????????????
		while(true){
			x = scan.nextInt();
			y = scan.nextInt();
			//x???0?????´??????true?????????
			if (x == 0){flg1= true;}
			//y???0?????´??????true?????????
			if (y == 0){flg2 = true;}
			//x??¨y???0?????´????????????????????????
			if ((flg1 == true) & (flg2 == true)){break;}
			
			//????????????????????????????????????????????????????????????
			list.add(x);
			list.add(y);
			
			Collections.sort(list);
			
			sb.append(list.get(0));
			sb.append(" ");
			sb.append(list.get(1));
			sb.append("\n");
			
			//???????????????????????????
			list.clear();
			
			//x??¨y????????????????????????0?????´????????????????¶??¶????????????????flg???false?????????
			flg1 = false;
			flg2 = false;
			
		}
		
		System.out.print(new String(sb));
		
		
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) StringBuilder sb = new StringBuilder(); sb new StringBuilder() int x x y; y List<Integer> list = new ArrayList<Integer>(); list new ArrayList<Integer>() boolean flg1 flg1 flg2; flg2 flg1 =false flg1 false flg2 = false flg2 false while(true){
			x = scan.nextInt();
			y = scan.nextInt();
			//x???0?????´??????true?????????
			if (x == 0){flg1= true;}
			//y???0?????´??????true?????????
			if (y == 0){flg2 = true;}
			//x??¨y???0?????´????????????????????????
			if ((flg1 == true) & (flg2 == true)){break;}
			
			//????????????????????????????????????????????????????????????
			list.add(x);
			list.add(y);
			
			Collections.sort(list);
			
			sb.append(list.get(0));
			sb.append(" ");
			sb.append(list.get(1));
			sb.append("\n");
			
			//???????????????????????????
			list.clear();
			
			//x??¨y????????????????????????0?????´????????????????¶??¶????????????????flg???false?????????
			flg1 = false;
			flg2 = false;
			
		} true {
			x = scan.nextInt();
			y = scan.nextInt();
			//x???0?????´??????true?????????
			if (x == 0){flg1= true;}
			//y???0?????´??????true?????????
			if (y == 0){flg2 = true;}
			//x??¨y???0?????´????????????????????????
			if ((flg1 == true) & (flg2 == true)){break;}
			
			//????????????????????????????????????????????????????????????
			list.add(x);
			list.add(y);
			
			Collections.sort(list);
			
			sb.append(list.get(0));
			sb.append(" ");
			sb.append(list.get(1));
			sb.append("\n");
			
			//???????????????????????????
			list.clear();
			
			//x??¨y????????????????????????0?????´????????????????¶??¶????????????????flg???false?????????
			flg1 = false;
			flg2 = false;
			
		} x = scan.nextInt() x scan.nextInt() scan.nextInt scan y = scan.nextInt() y scan.nextInt() scan.nextInt scan if (x == 0){flg1= true;} x == 0 x 0 {flg1= true;} flg1= true flg1 true if (y == 0){flg2 = true;} y == 0 y 0 {flg2 = true;} flg2 = true flg2 true if ((flg1 == true) & (flg2 == true)){break;} (flg1 == true) & (flg2 == true) (flg1 == true) flg1 true (flg2 == true) flg2 true {break;} break; list.add(x) list.add list x list.add(y) list.add list y Collections.sort(list) Collections.sort Collections list sb.append(list.get(0)) sb.append sb list.get(0) list.get list 0 sb.append(" ") sb.append sb " " sb.append(list.get(1)) sb.append sb list.get(1) list.get list 1 sb.append("\n") sb.append sb "\n" list.clear() list.clear list flg1 = false flg1 false flg2 = false flg2 false System.out.print(new String(sb)) System.out.print System.out System System.out new String(sb) String args[] args public class Main {
	public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		
		int x,y;
		List<Integer> list = new ArrayList<Integer>();
		
		boolean flg1,flg2;
		flg1 =false;
		flg2 = false;
		
		//??????0??§????????????
		while(true){
			x = scan.nextInt();
			y = scan.nextInt();
			//x???0?????´??????true?????????
			if (x == 0){flg1= true;}
			//y???0?????´??????true?????????
			if (y == 0){flg2 = true;}
			//x??¨y???0?????´????????????????????????
			if ((flg1 == true) & (flg2 == true)){break;}
			
			//????????????????????????????????????????????????????????????
			list.add(x);
			list.add(y);
			
			Collections.sort(list);
			
			sb.append(list.get(0));
			sb.append(" ");
			sb.append(list.get(1));
			sb.append("\n");
			
			//???????????????????????????
			list.clear();
			
			//x??¨y????????????????????????0?????´????????????????¶??¶????????????????flg???false?????????
			flg1 = false;
			flg2 = false;
			
		}
		
		System.out.print(new String(sb));
		
		
	}
} public class Main {
	public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		
		int x,y;
		List<Integer> list = new ArrayList<Integer>();
		
		boolean flg1,flg2;
		flg1 =false;
		flg2 = false;
		
		//??????0??§????????????
		while(true){
			x = scan.nextInt();
			y = scan.nextInt();
			//x???0?????´??????true?????????
			if (x == 0){flg1= true;}
			//y???0?????´??????true?????????
			if (y == 0){flg2 = true;}
			//x??¨y???0?????´????????????????????????
			if ((flg1 == true) & (flg2 == true)){break;}
			
			//????????????????????????????????????????????????????????????
			list.add(x);
			list.add(y);
			
			Collections.sort(list);
			
			sb.append(list.get(0));
			sb.append(" ");
			sb.append(list.get(1));
			sb.append("\n");
			
			//???????????????????????????
			list.clear();
			
			//x??¨y????????????????????????0?????´????????????????¶??¶????????????????flg???false?????????
			flg1 = false;
			flg2 = false;
			
		}
		
		System.out.print(new String(sb));
		
		
	}
} Main

import java.util.*;

public class Main {
	public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		
		int x,y;
		List<Integer> list = new ArrayList<Integer>();
		
		boolean flg1,flg2;
		flg1 =false;
		flg2 = false;
		
		//??????0??§????????????
		while(true){
			x = scan.nextInt();
			y = scan.nextInt();
			//x???0?????´??????true?????????
			if (x == 0){flg1= true;}
			//y???0?????´??????true?????????
			if (y == 0){flg2 = true;}
			//x??¨y???0?????´????????????????????????
			if ((flg1 == true) & (flg2 == true)){break;}
			
			//????????????????????????????????????????????????????????????
			list.add(x);
			list.add(y);
			
			Collections.sort(list);
			
			sb.append(list.get(0));
			sb.append(" ");
			sb.append(list.get(1));
			sb.append("\n");
			
			//???????????????????????????
			list.clear();
			
			//x??¨y????????????????????????0?????´????????????????¶??¶????????????????flg???false?????????
			flg1 = false;
			flg2 = false;
			
		}
		
		System.out.print(new String(sb));
		
		
	}
}