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

#GL0000075. BCNN nhỏ nhất của hai số có tổng cố định (Minimum LCM)

HỌC THEO LỘ TRÌNH

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

1 lộ trình

BCNN nhỏ nhất của hai số có tổng cố định (Minimum LCM)

Minimum LCM

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

Given an integer nn, split it into a sum of two positive integers aa and bb. Among all such splits, minimize lcm⁡(a,b)\operatorname{lcm}(a,b). If multiple optimal pairs exist, print any one.

Input

One integer nn.

Output

Print two positive integers a,ba,b whose sum is nn and whose LCM is minimum.

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

10

Output

5 5

Explanation

The pair (5,5)(5,5) sums to 1010 and has LCM 55. Other unordered pairs (1,9),(2,8),(3,7),(4,6)(1,9),(2,8),(3,7),(4,6) have LCMs 9,8,21,129,8,21,12, all larger than 55.