Under construction

Still being built. Things may change

Greatest Greatest Common Divisor

Interview

Time limit1sMemory limit1024 MB

Summary
Given L and R with R - L at most 10^6, find two distinct integers in [L, R] whose greatest common divisor is as large as possible.
Level

Medium5 of 10

Topics
Number theory, Brute force, Math
Solved
No attempts yet

Statement

Everyone has met problems with a lazy statement. This problem is no exception.

Find a pair of distinct integers with the largest greatest common divisor among all pairs of distinct x,yx,y such that L≤x,y≤RL \le x,y \le R.

Input

Two integers LL and RR are given (1≤L<R≤1018,R−L≤106)(1 \le L < R \le 10^{18}, R - L \le 10^{6}).

Output

Print a pair of distinct integers with the largest greatest common divisor. If there are several such pairs, print any of them.

Examples1

  1. Example 1

    Input
    4 13
    
    Expected output
    6 12