Sevens, Twos and Zeros

No attempts yetTime limit1sMemory limit128 MB

Problem

Given a natural number $n$, write a program that outputs the smallest number $s$ satisfying all of the following conditions.

  • $s \ge n$;
  • written in decimal, $s$ consists only of the digits 7, 2 and 0, and does not start with 0;
  • the decimal representation of $s$ has at most 20 digits;
  • $s$ divided by $n$ leaves a remainder of 0.

Input

A single natural number $n$ ($0 < n < 500000$) is given on one line.

Output

Output the number $s$ described above. If no such $s$ exists for the given $n$, output the single word NAV.