Equal numbers#366

Equal numbers

1 second
64 megabytes
Easy

Given a positive integer . Find the smallest positive integer, all of whose digits are the same, that is a multiple of (in the decimal system).

Input

You are given the number (2 \leq K \leq 1000).

Output

Output the digit and the number of digits in such a number. If no such number exists, output 0 0.

Examples

Example 1

Loading
Loading