import scala.math._
import scala.collection.mutable.ListBuffer

object Main {
  //rt.gc()??§??¬??????????????¬?????????????????????
  //val rt = Runtime.getRuntime()
  val sc = new java.util.Scanner(System.in)
  def isPrime(n: Int): Boolean =  {
    if(n == 1) {
      return false
    }
    var i = 2
    while(i*i <= n) {
      if(n % i == 0) {
        return false
      }
      i += 1
    }
    return true
  }
  def main(args: Array[String]) {
    val twinPrimes = (for {
      i <- 5 to 10000
      if isPrime(i)
        if isPrime(i-2)
      } yield {
      (i-2, i)
    }).toList
    while(true) {
      val n = sc.nextInt
      if(n == 0) {
        return
      }
      val (p, q) = twinPrimes.filter(_._2 <= n).last
      println(p + " " + q)
    }
  }
}