main = getContents >>= putStr . unlines . map solve . init . map (rl . words) . lines

rl :: [String] -> [Int]
rl = map read

solve :: [Int] -> String
solve [] = []
solve (x:y:[]) = if x > y then (show y) ++ " " ++ (show x)
                          else (show x) ++ " " ++ (show y)
