import java.util.*;
  
class Main{
  public static void main(String[] args){
    Scanner stdId = new Scanner(System.in);
    int x = stdId.nextInt(); 
    int y = stdId.nextInt(); 
    while(x!=0 || y!=0){
      System.out.println(Math.min(x,y) + " " + Math.max(x,y));
      x = stdId.nextInt();
      y = stdId.nextInt();
    }
  }
} import java.util.*; util.* java class Main{
  public static void main(String[] args){
    Scanner stdId = new Scanner(System.in);
    int x = stdId.nextInt(); 
    int y = stdId.nextInt(); 
    while(x!=0 || y!=0){
      System.out.println(Math.min(x,y) + " " + Math.max(x,y));
      x = stdId.nextInt();
      y = stdId.nextInt();
    }
  }
} Main public static void main(String[] args){
    Scanner stdId = new Scanner(System.in);
    int x = stdId.nextInt(); 
    int y = stdId.nextInt(); 
    while(x!=0 || y!=0){
      System.out.println(Math.min(x,y) + " " + Math.max(x,y));
      x = stdId.nextInt();
      y = stdId.nextInt();
    }
  } main {
    Scanner stdId = new Scanner(System.in);
    int x = stdId.nextInt(); 
    int y = stdId.nextInt(); 
    while(x!=0 || y!=0){
      System.out.println(Math.min(x,y) + " " + Math.max(x,y));
      x = stdId.nextInt();
      y = stdId.nextInt();
    }
  } Scanner stdId = new Scanner(System.in); stdId new Scanner(System.in) int x = stdId.nextInt(); x stdId.nextInt() stdId.nextInt stdId int y = stdId.nextInt(); y stdId.nextInt() stdId.nextInt stdId while(x!=0 || y!=0){
      System.out.println(Math.min(x,y) + " " + Math.max(x,y));
      x = stdId.nextInt();
      y = stdId.nextInt();
    } x!=0 || y!=0 x!=0 x 0 y!=0 y 0 {
      System.out.println(Math.min(x,y) + " " + Math.max(x,y));
      x = stdId.nextInt();
      y = stdId.nextInt();
    } System.out.println(Math.min(x,y) + " " + Math.max(x,y)) System.out.println System.out System System.out Math.min(x,y) + " " + Math.max(x,y) Math.min(x,y) + " " + Math.max(x,y) Math.min(x,y) Math.min Math x y " " Math.max(x,y) Math.max Math x y x = stdId.nextInt() x stdId.nextInt() stdId.nextInt stdId y = stdId.nextInt() y stdId.nextInt() stdId.nextInt stdId String[] args args
import java.util.*;
  
class Main{
  public static void main(String[] args){
    Scanner stdId = new Scanner(System.in);
    int x = stdId.nextInt(); 
    int y = stdId.nextInt(); 
    while(x!=0 || y!=0){
      System.out.println(Math.min(x,y) + " " + Math.max(x,y));
      x = stdId.nextInt();
      y = stdId.nextInt();
    }
  }
}