import std.stdio, std.conv, std.string, std.array, std.algorithm;

void main() {
  while (true) {
    string[] input = split(readln());
    int a = to!int(input[0]), b = to!int(input[1]);

    if (a == 0 && b == 0) break;

    if (a > b) swap(a, b);

    writef("%d %d\n", a, b);
  }
}