main :: IO ()
main = do
  n <- readLn
  if n == 0
    then return ()
    else do
      putStrLn $ solve n
      main

solve :: Int -> String
solve n = format (findTwin (prime n))
  where
    format :: (Int,Int) -> String
    format (a,b) = (show a) ++ " " ++ (show b)

    findTwin :: [Int] -> (Int,Int)
    findTwin ls = findTwin' (reverse ls)
      where
        findTwin' :: [Int] -> (Int,Int)
        findTwin' (x:y:r)
          | x - y == 2 = (y,x)
          | otherwise = findTwin' (y:r)
    prime :: Int -> [Int]
    prime n = loop [2..n]
      where
        loop :: [Int] -> [Int]
        loop [] = []
        loop (x:xs) = x:(loop (filter (\y -> y `mod` x /= 0) xs))