cho.sh
Notes
Loading...

Broken Calculator

Time limit

2s

Memory limit

128 MB

Problem

Dasom's favorite possession is a calculator. After she dropped it one day, the calculator can now display only numbers with at most D digits.

The number initially shown on the calculator is 1. Dasom wants to use the calculator to perform exactly P multiplications. For each multiplication, she multiplies the currently displayed number by one natural number from 2 through 9. The result of each multiplication must have at most D digits.

Write a program that finds the largest number Dasom can make after exactly P multiplications.

Input

The first line contains D, the maximum number of digits the calculator can display, and P, the number of multiplications Dasom wants to perform.

D is a natural number between 2 and 8 inclusive, and P is a nonnegative integer at most 30.

Output

Print the largest number that can be made after exactly P multiplications. If every possible result after exactly P multiplications exceeds D digits, print -1.