let rec f () =
  let (x, y) = Scanf.scanf "%d %d\n" (fun x y -> x,y) in
  match (x, y) with
    (0, 0) -> ()
  | _ -> print_int @@ min x y; print_string " ";
    print_int @@ max x y; print_newline (); f ()

let () = f ()