package main import ( "bufio" "fmt" "math" "os" "strconv" ) var sc = bufio.NewScanner(os.Stdin) func Scanner() string { sc.Scan() return sc.Text() } func main() { buf := make([]byte, 0) sc.Buffer(buf, 100000007) sc.Split(bufio.ScanWords) x, _ := strconv.Atoi(Scanner()) ans := []int{} box := make([]int, x+1) for i := 1; i < x; i++ { for j := i; j <= x; j += i { box[j]++ } } min := math.MaxInt32 for i := 1; i < x; i++ { num := abs((i - box[i]) - ((x - i) - box[x-i])) if num == min { ans = append(ans, i) } else if num < min { min = num ans = []int{i} } } for _, i := range ans { fmt.Println(i, x-i) } } func abs(n int) int { if n > 0 { return n } else { return n * -1 } }