import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

/**
 * Created 2017/06/01.
 */
public class Main {
  public static void main(String[] args) {
    //??\?????¨?????????
    Scanner sc = new Scanner(System.in);
    ArrayList<ArrayList<Integer>> ary_ans = new ArrayList<>();
    while (true) {
      ArrayList<Integer> ary = new ArrayList<>();
      int input1 = Integer.parseInt(sc.next());
      int input2 = Integer.parseInt(sc.next());
      ary.add(input1);
      ary.add(input2);
      Collections.sort(ary);    //??????????????§?????????????????????????´???´????????????
      ary_ans.add(ary);
      if (input1 == 0 && input2 == 0) break;
    }
    //System.out.println(ary_ans);//????????????????´???´???????????? ????????????????????????????´???´???????????????????????????

    //????????¨???????????????????°?????°???????
    for (int i = 0; i < ary_ans.size() - 1; i++) {
      for (int j = 0; j < ary_ans.get(i).size(); j++) {
        System.out.println(ary_ans.get(i).get(j) + " " + ary_ans.get(i).get(j + 1));
        if (j == ary_ans.get(i).size()) ;
        break;
      }
    }
  }
} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.Scanner; Scanner java.util public class Main {
  public static void main(String[] args) {
    //??\?????¨?????????
    Scanner sc = new Scanner(System.in);
    ArrayList<ArrayList<Integer>> ary_ans = new ArrayList<>();
    while (true) {
      ArrayList<Integer> ary = new ArrayList<>();
      int input1 = Integer.parseInt(sc.next());
      int input2 = Integer.parseInt(sc.next());
      ary.add(input1);
      ary.add(input2);
      Collections.sort(ary);    //??????????????§?????????????????????????´???´????????????
      ary_ans.add(ary);
      if (input1 == 0 && input2 == 0) break;
    }
    //System.out.println(ary_ans);//????????????????´???´???????????? ????????????????????????????´???´???????????????????????????

    //????????¨???????????????????°?????°???????
    for (int i = 0; i < ary_ans.size() - 1; i++) {
      for (int j = 0; j < ary_ans.get(i).size(); j++) {
        System.out.println(ary_ans.get(i).get(j) + " " + ary_ans.get(i).get(j + 1));
        if (j == ary_ans.get(i).size()) ;
        break;
      }
    }
  }
} Main public static void main(String[] args) {
    //??\?????¨?????????
    Scanner sc = new Scanner(System.in);
    ArrayList<ArrayList<Integer>> ary_ans = new ArrayList<>();
    while (true) {
      ArrayList<Integer> ary = new ArrayList<>();
      int input1 = Integer.parseInt(sc.next());
      int input2 = Integer.parseInt(sc.next());
      ary.add(input1);
      ary.add(input2);
      Collections.sort(ary);    //??????????????§?????????????????????????´???´????????????
      ary_ans.add(ary);
      if (input1 == 0 && input2 == 0) break;
    }
    //System.out.println(ary_ans);//????????????????´???´???????????? ????????????????????????????´???´???????????????????????????

    //????????¨???????????????????°?????°???????
    for (int i = 0; i < ary_ans.size() - 1; i++) {
      for (int j = 0; j < ary_ans.get(i).size(); j++) {
        System.out.println(ary_ans.get(i).get(j) + " " + ary_ans.get(i).get(j + 1));
        if (j == ary_ans.get(i).size()) ;
        break;
      }
    }
  } main {
    //??\?????¨?????????
    Scanner sc = new Scanner(System.in);
    ArrayList<ArrayList<Integer>> ary_ans = new ArrayList<>();
    while (true) {
      ArrayList<Integer> ary = new ArrayList<>();
      int input1 = Integer.parseInt(sc.next());
      int input2 = Integer.parseInt(sc.next());
      ary.add(input1);
      ary.add(input2);
      Collections.sort(ary);    //??????????????§?????????????????????????´???´????????????
      ary_ans.add(ary);
      if (input1 == 0 && input2 == 0) break;
    }
    //System.out.println(ary_ans);//????????????????´???´???????????? ????????????????????????????´???´???????????????????????????

    //????????¨???????????????????°?????°???????
    for (int i = 0; i < ary_ans.size() - 1; i++) {
      for (int j = 0; j < ary_ans.get(i).size(); j++) {
        System.out.println(ary_ans.get(i).get(j) + " " + ary_ans.get(i).get(j + 1));
        if (j == ary_ans.get(i).size()) ;
        break;
      }
    }
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) ArrayList<ArrayList<Integer>> ary_ans = new ArrayList<>(); ary_ans new ArrayList<>() while (true) {
      ArrayList<Integer> ary = new ArrayList<>();
      int input1 = Integer.parseInt(sc.next());
      int input2 = Integer.parseInt(sc.next());
      ary.add(input1);
      ary.add(input2);
      Collections.sort(ary);    //??????????????§?????????????????????????´???´????????????
      ary_ans.add(ary);
      if (input1 == 0 && input2 == 0) break;
    } true {
      ArrayList<Integer> ary = new ArrayList<>();
      int input1 = Integer.parseInt(sc.next());
      int input2 = Integer.parseInt(sc.next());
      ary.add(input1);
      ary.add(input2);
      Collections.sort(ary);    //??????????????§?????????????????????????´???´????????????
      ary_ans.add(ary);
      if (input1 == 0 && input2 == 0) break;
    } ArrayList<Integer> ary = new ArrayList<>(); ary new ArrayList<>() int input1 = Integer.parseInt(sc.next()); input1 Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int input2 = Integer.parseInt(sc.next()); input2 Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc ary.add(input1) ary.add ary input1 ary.add(input2) ary.add ary input2 Collections.sort(ary) Collections.sort Collections ary ary_ans.add(ary) ary_ans.add ary_ans ary if (input1 == 0 && input2 == 0) break; input1 == 0 && input2 == 0 input1 == 0 input1 0 input2 == 0 input2 0 break; for (int i = 0; i < ary_ans.size() - 1; i++) {
      for (int j = 0; j < ary_ans.get(i).size(); j++) {
        System.out.println(ary_ans.get(i).get(j) + " " + ary_ans.get(i).get(j + 1));
        if (j == ary_ans.get(i).size()) ;
        break;
      }
    } int i = 0; int i = 0; i 0 i < ary_ans.size() - 1 i ary_ans.size() - 1 ary_ans.size() ary_ans.size ary_ans 1 i++ i++ i {
      for (int j = 0; j < ary_ans.get(i).size(); j++) {
        System.out.println(ary_ans.get(i).get(j) + " " + ary_ans.get(i).get(j + 1));
        if (j == ary_ans.get(i).size()) ;
        break;
      }
    } {
      for (int j = 0; j < ary_ans.get(i).size(); j++) {
        System.out.println(ary_ans.get(i).get(j) + " " + ary_ans.get(i).get(j + 1));
        if (j == ary_ans.get(i).size()) ;
        break;
      }
    } for (int j = 0; j < ary_ans.get(i).size(); j++) {
        System.out.println(ary_ans.get(i).get(j) + " " + ary_ans.get(i).get(j + 1));
        if (j == ary_ans.get(i).size()) ;
        break;
      } int j = 0; int j = 0; j 0 j < ary_ans.get(i).size() j ary_ans.get(i).size() ary_ans.get(i).size ary_ans.get(i) ary_ans.get ary_ans i j++ j++ j {
        System.out.println(ary_ans.get(i).get(j) + " " + ary_ans.get(i).get(j + 1));
        if (j == ary_ans.get(i).size()) ;
        break;
      } {
        System.out.println(ary_ans.get(i).get(j) + " " + ary_ans.get(i).get(j + 1));
        if (j == ary_ans.get(i).size()) ;
        break;
      } System.out.println(ary_ans.get(i).get(j) + " " + ary_ans.get(i).get(j + 1)) System.out.println System.out System System.out ary_ans.get(i).get(j) + " " + ary_ans.get(i).get(j + 1) ary_ans.get(i).get(j) + " " + ary_ans.get(i).get(j + 1) ary_ans.get(i).get(j) ary_ans.get(i).get ary_ans.get(i) ary_ans.get ary_ans i j " " ary_ans.get(i).get(j + 1) ary_ans.get(i).get ary_ans.get(i) ary_ans.get ary_ans i j + 1 j 1 if (j == ary_ans.get(i).size()) ; j == ary_ans.get(i).size() j ary_ans.get(i).size() ary_ans.get(i).size ary_ans.get(i) ary_ans.get ary_ans i break; String[] args args public class Main {
  public static void main(String[] args) {
    //??\?????¨?????????
    Scanner sc = new Scanner(System.in);
    ArrayList<ArrayList<Integer>> ary_ans = new ArrayList<>();
    while (true) {
      ArrayList<Integer> ary = new ArrayList<>();
      int input1 = Integer.parseInt(sc.next());
      int input2 = Integer.parseInt(sc.next());
      ary.add(input1);
      ary.add(input2);
      Collections.sort(ary);    //??????????????§?????????????????????????´???´????????????
      ary_ans.add(ary);
      if (input1 == 0 && input2 == 0) break;
    }
    //System.out.println(ary_ans);//????????????????´???´???????????? ????????????????????????????´???´???????????????????????????

    //????????¨???????????????????°?????°???????
    for (int i = 0; i < ary_ans.size() - 1; i++) {
      for (int j = 0; j < ary_ans.get(i).size(); j++) {
        System.out.println(ary_ans.get(i).get(j) + " " + ary_ans.get(i).get(j + 1));
        if (j == ary_ans.get(i).size()) ;
        break;
      }
    }
  }
} public class Main {
  public static void main(String[] args) {
    //??\?????¨?????????
    Scanner sc = new Scanner(System.in);
    ArrayList<ArrayList<Integer>> ary_ans = new ArrayList<>();
    while (true) {
      ArrayList<Integer> ary = new ArrayList<>();
      int input1 = Integer.parseInt(sc.next());
      int input2 = Integer.parseInt(sc.next());
      ary.add(input1);
      ary.add(input2);
      Collections.sort(ary);    //??????????????§?????????????????????????´???´????????????
      ary_ans.add(ary);
      if (input1 == 0 && input2 == 0) break;
    }
    //System.out.println(ary_ans);//????????????????´???´???????????? ????????????????????????????´???´???????????????????????????

    //????????¨???????????????????°?????°???????
    for (int i = 0; i < ary_ans.size() - 1; i++) {
      for (int j = 0; j < ary_ans.get(i).size(); j++) {
        System.out.println(ary_ans.get(i).get(j) + " " + ary_ans.get(i).get(j + 1));
        if (j == ary_ans.get(i).size()) ;
        break;
      }
    }
  }
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

/**
 * Created 2017/06/01.
 */
public class Main {
  public static void main(String[] args) {
    //??\?????¨?????????
    Scanner sc = new Scanner(System.in);
    ArrayList<ArrayList<Integer>> ary_ans = new ArrayList<>();
    while (true) {
      ArrayList<Integer> ary = new ArrayList<>();
      int input1 = Integer.parseInt(sc.next());
      int input2 = Integer.parseInt(sc.next());
      ary.add(input1);
      ary.add(input2);
      Collections.sort(ary);    //??????????????§?????????????????????????´???´????????????
      ary_ans.add(ary);
      if (input1 == 0 && input2 == 0) break;
    }
    //System.out.println(ary_ans);//????????????????´???´???????????? ????????????????????????????´???´???????????????????????????

    //????????¨???????????????????°?????°???????
    for (int i = 0; i < ary_ans.size() - 1; i++) {
      for (int j = 0; j < ary_ans.get(i).size(); j++) {
        System.out.println(ary_ans.get(i).get(j) + " " + ary_ans.get(i).get(j + 1));
        if (j == ary_ans.get(i).size()) ;
        break;
      }
    }
  }
}