PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GL0000073. Omkar và tiết học Toán cuối cùng (Omkar and Last Class of Math)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Omkar và tiết học Toán cuối cùng (Omkar and Last Class of Math)

Omkar and Last Class of Math

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

Given an integer nn, choose two positive integers a,ba,b with a+b=na+b=n. Minimize their least common multiple lcm⁡(a,b)\operatorname{lcm}(a,b). Any optimal pair is acceptable.

Input

One integer nn.

Output

Print two positive integers a,ba,b summing to nn with minimum LCM.

Subtasks

  • Subtask 1 (20 points): 2≤n≤1002\le n\le100.

  • Subtask 2 (30 points): 2≤n≤1062\le n\le10^6.

  • Subtask 3 (50 points): 2≤n≤1092\le n\le10^9.

Examples

Input

9

Output

3 6

Explanation

The pair (3,6)(3,6) sums to 99 and has LCM 66. Other unordered pairs (1,8)(1,8), (2,7)(2,7) and (4,5)(4,5) have LCMs 88, 1414 and 2020 respectively. Thus 66 is the minimum.