let sorted_string = function
  | 0 :: [0] -> None
  | x :: [y] when x <= y -> Some ((string_of_int x) ^ " " ^ (string_of_int y))
  | x :: [y] when x > y -> Some ((string_of_int y) ^ " " ^ (string_of_int x))
  | _ -> None;;

let rec loop () =
  read_line()
  |> Str.split (Str.regexp " ")
  |> List.map int_of_string
  |> sorted_string
  |> function | None -> ()
              | Some x -> print_endline x;
                loop();;

loop()

