#[allow(dead_code)] #[allow(unused_imports)] fn read() -> T { use std::io::*; let stdin = stdin(); let stdin = stdin.lock(); let token: String = stdin .bytes() .map(|c| c.expect("failed to read char") as char) .skip_while(|c| c.is_whitespace()) .take_while(|c| !c.is_whitespace()) .collect(); token.parse().ok().expect("failed to parse token") } fn main(){ let mut x:usize = read(); let mut f:Vec<_> = (0..=x).map(|i| i as i64).collect(); for i in 1..=x { f[i] -= 1; let mut mul = 2; while i * mul <= x { f[i * mul] -= 1; mul += 1; } } let mut res = Vec::new(); let mut ans = 1e18 as i64; for i in 1..=x/2 { ans = std::cmp::min(ans,(f[i] - f[x - i]).abs()); } for i in 1..=x/2 { if ans == (f[i] - f[x - i].abs()) { res.push((i,x - i)); if i != x - i { res.push((x - i,i)); } } } res.sort(); for i in 0..res.len() { println!("{} {}",res[i].0,res[i].1); } }