
import std.stdio, std.algorithm, std.array;

bool[] make_prime_table(int n) {
  bool[] table = new bool[](n + 1);
  foreach(ref x; table) x = true;
  table[0] = table[1] = false;
  for(int i = 2; i * i < n + 1; i++) {
    if (table[i]) {
      for(int j = 2 * i; j < n + 1; j += i) table[j] = false;
    }
  }
  return table;
}

void main() {
  bool[] is_prime = make_prime_table(10000);
  for(int n; readf("%d\n", &n), n != 0;) {
    while(!is_prime[n] || !is_prime[n - 2]) n--;
    writeln(n - 2, " ", n);
  }
}