import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            solve(in);
        }
    }

    private static void solve(Scanner in) {
        for (int x = in.nextInt(), y = in.nextInt();
                x != 0 || y != 0;
                x = in.nextInt(), y = in.nextInt()) {
            int a = x < y ? x : y, b = x < y ? y : x;
            System.out.printf("%d %d\n", a, b);
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            solve(in);
        }
    }

    private static void solve(Scanner in) {
        for (int x = in.nextInt(), y = in.nextInt();
                x != 0 || y != 0;
                x = in.nextInt(), y = in.nextInt()) {
            int a = x < y ? x : y, b = x < y ? y : x;
            System.out.printf("%d %d\n", a, b);
        }
    }
} Main public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            solve(in);
        }
    } main {
        try (Scanner in = new Scanner(System.in)) {
            solve(in);
        }
    } try (Scanner in = new Scanner(System.in)) {
            solve(in);
        } {
            solve(in);
        } Scanner in = new Scanner(System.in) Scanner in = new Scanner(System.in) new Scanner(System.in) solve(in) solve in String[] args args private static void solve(Scanner in) {
        for (int x = in.nextInt(), y = in.nextInt();
                x != 0 || y != 0;
                x = in.nextInt(), y = in.nextInt()) {
            int a = x < y ? x : y, b = x < y ? y : x;
            System.out.printf("%d %d\n", a, b);
        }
    } solve {
        for (int x = in.nextInt(), y = in.nextInt();
                x != 0 || y != 0;
                x = in.nextInt(), y = in.nextInt()) {
            int a = x < y ? x : y, b = x < y ? y : x;
            System.out.printf("%d %d\n", a, b);
        }
    } for (int x = in.nextInt(), y = in.nextInt();
                x != 0 || y != 0;
                x = in.nextInt(), y = in.nextInt()) {
            int a = x < y ? x : y, b = x < y ? y : x;
            System.out.printf("%d %d\n", a, b);
        } int x = in.nextInt(), y = in.nextInt(); int x = in.nextInt() x in.nextInt() in.nextInt in y = in.nextInt(); y in.nextInt() in.nextInt in x != 0 || y != 0 x != 0 x 0 y != 0 y 0 x = in.nextInt(), y = in.nextInt() x = in.nextInt() x in.nextInt() in.nextInt in y = in.nextInt() y in.nextInt() in.nextInt in {
            int a = x < y ? x : y, b = x < y ? y : x;
            System.out.printf("%d %d\n", a, b);
        } {
            int a = x < y ? x : y, b = x < y ? y : x;
            System.out.printf("%d %d\n", a, b);
        } int a = x < y ? x : y a x < y ? x : y x < y x y x y b = x < y ? y : x; b x < y ? y : x x < y x y y x System.out.printf("%d %d\n", a, b) System.out.printf System.out System System.out "%d %d\n" a b Scanner in in public class Main {

    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            solve(in);
        }
    }

    private static void solve(Scanner in) {
        for (int x = in.nextInt(), y = in.nextInt();
                x != 0 || y != 0;
                x = in.nextInt(), y = in.nextInt()) {
            int a = x < y ? x : y, b = x < y ? y : x;
            System.out.printf("%d %d\n", a, b);
        }
    }
} public class Main {

    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            solve(in);
        }
    }

    private static void solve(Scanner in) {
        for (int x = in.nextInt(), y = in.nextInt();
                x != 0 || y != 0;
                x = in.nextInt(), y = in.nextInt()) {
            int a = x < y ? x : y, b = x < y ? y : x;
            System.out.printf("%d %d\n", a, b);
        }
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            solve(in);
        }
    }

    private static void solve(Scanner in) {
        for (int x = in.nextInt(), y = in.nextInt();
                x != 0 || y != 0;
                x = in.nextInt(), y = in.nextInt()) {
            int a = x < y ? x : y, b = x < y ? y : x;
            System.out.printf("%d %d\n", a, b);
        }
    }
}