Logo C++ Online Judge

C++

时间限制:1 s 空间限制:128 MB
TA: 惠宇龙
Statistics
Topic Background

In the class, every student has the serial number. For student $A$ and $B$, if the sum of the factor (约数) of $A$'s serial number is exactly equal to $B$'s serial number, then $A$'s "good friend" is $B$. Here, the factor of a number does not include the number itself. Some students have no good friends because the sum of their factors is greater than any other student's number. Some students have a “very good friend”: When two students are each other's "good friend”, they are a pair of “very good friends".

Description

Given a serial number $s$, find the first “very good friend” whose serial number is not less than $s$. Note that in this question, ignore the cases where you are your own “very good friend”.

Input Format

There is only one line with an integer $s$, which is the lower bound of the serial number.

Output format

Outputs a line of two integers $a$ and $b$, separated by a space.

$a$ denotes the first student with serial number not less than $s$ who has a “very good friend”, and $b$ is the “very good friend” of $a$. (Note: $ b < s$ is allowed)

Constraint

$6\le s\le1.8\times10^4$

Input Example
200

Output Example

220 284