#BS0000075. Mua một số nguyên (Buy an Integer)

Mua một số nguyên (Buy an Integer)

Buy an Integer

Source: AtCoder

Version: Phuoc Hung OJ Extended

Problem Statement

Integers 1..1091..10^9 are sold. Integer NN costs AN+B d(N)AN+B\,d(N) where d(N)d(N) is its decimal digit count. With budget XX, find the greatest affordable integer, or 0 if none.

Input

The only line contains A,B,XA,B,X.

Output

Print the greatest affordable integer or 0.

Subtasks

  • Subtask 1 — 20%: A,B,X≤106A,B,X\le10^6.
  • Subtask 2 — 30%: X≤1012X\le10^{12}.
  • Subtask 3 — 50%: A,B≤109A,B\le10^9, X≤1018X\le10^{18}.

Example

Input

10 7 100

Output

9

Explanation

9 costs 97, while 10 costs 114.