use std::io::*; fn main() { let mut s: String = String::new(); std::io::stdin().read_to_string(&mut s).ok(); let mut itr = s.trim().split_whitespace(); let n: i64 = itr.next().unwrap().parse().unwrap(); let mut d = vec![0i64; n as usize + 2]; d[1] = 1; for m in 1..n { // mの約数の個数 let mut i = 1; let c = &mut d[m as usize]; *c += m; while i * i <= m { if m % i == 0 { if m / i == m / (m / i) { *c -= 1; } else { *c -= 2; } } i += 1; } } let mut min = 1 << 30; for i in 1..n / 2 + 1 { min = std::cmp::min(min, (d[(n - i) as usize] - d[i as usize]).abs()); } let mut ans = Vec::new(); for i in 1..n / 2 + 1 { if (d[(n - i) as usize] - d[i as usize]).abs() == min { ans.push((i, n - i)); ans.push((n - i, i)); } } ans.sort(); let mut out = Vec::new(); for &i in ans.iter() { writeln!(out, "{} {}", i.0, i.1).ok(); } stdout().write_all(&out).unwrap(); }