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

#GL0000202. Tìm giai thừa có đúng số chữ số 0 cuối (Trailing Zeroes (III))

HỌC THEO LỘ TRÌNH

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

1 lộ trình

Tìm giai thừa có đúng số chữ số 0 cuối (Trailing Zeroes (III))

Tìm giai thừa có đúng số chữ số 0 cuối (Trailing Zeroes (III))

Source: LightOJ

Version: Phuoc Hung OJ Extended

Problem Statement

Given Q≥1Q\ge1, find the smallest nonnegative integer NN for which N!N! ends with exactly QQ trailing zeros in decimal notation. Print impossible (lowercase) if such NN does not exist.

Input

A single integer QQ.

Output

Print the minimum NN or impossible.

Subtasks

  • Subtask 1 (20 points): 1≤Q≤1001\le Q\le 100.

  • Subtask 2 (30 points): 1≤Q≤1000001\le Q\le 100000.

  • Subtask 3 (50 points): 1≤Q≤1000000001\le Q\le 100000000.

Examples

Example 1

Input

1

Output

5

Explanation

5!=120 has one trailing zero; smaller factorials have none.

Example 2

Input

2

Output

10

Explanation

10! has two factors of five and is the smallest factorial with two trailing zeros.

Example 3

Input

5

Output

impossible

Explanation

The zero count jumps from 4 at 24! to 6 at 25!, skipping 5.