swapPut :: [Int]->String
swapPut [x,y] = if x<=y
	then show x ++ " " ++ show y
	else show y ++ " " ++ show x

mapToIntList :: String->[Int]
mapToInt = map read.words

flipIntPairList :: [[Int]]->[String]
flipIntPairList xs = case xs of
	([0,0]:_)->[]
	(x:xs)-> swapPut x : flipIntPairList xs

main=getContents>>=mapM_ putStrLn.flipIntPairList.map mapToIntList.lines