This page is still under construction.

Parts of this page are still being built. What you see may change.

Key

Time limit1sMemory limit128 MB

Summary
Find every odd K in [A, B] such that (K-1)! is not a multiple of K^2, where B - A is at most 100 but B can be 10^18.
Level

Medium7 of 10

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

Problem

While cracking the passwords of several data encryption systems, a novice hacker discovered the rule by which encryption keys are formed. An encryption key is an odd integer KK that satisfies both of the following conditions:

  • K2K^2 does not divide (K−1)!(K-1)!; that is, (K−1)!(K-1)! is not a multiple of K2K^2.
  • A≤K≤BA \le K \le B

Here (K−1)!=(K−1)×(K−2)×⋯×2×1(K-1)! = (K-1) \times (K-2) \times \cdots \times 2 \times 1.

Find all possible encryption keys KK within the range [A,B][A, B].

Input

Two integers AA and BB are given on a single line, separated by a space. (3≤A<B≤10183 \le A < B \le 10^{18}, B−A≤100B - A \le 100)

Output

Print all encryption keys KK in the range on a single line, in ascending order, separated by single spaces. It is guaranteed that at least one key exists in the range.

Examples2

  1. Example 1

    Input
    3 8
    
    Expected output
    3 5 7
    
  2. Example 2

    Input
    7 14
    
    Expected output
    7 9 11 13