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

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

    findTwin :: [Int] -> (Int,Int)
    findTwin (x:y:r)
      | x - y == 2 = (y,x)
      | otherwise = findTwin (y:r)
    getN :: Int -> [Int] -> [Int]
    getN _ [] = []
    getN n (x:xs)
      | x < n = x:(getN n xs)
      | x == n = [x]
      | x > n = []
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))
primeL = prime 10000