Grandpa Frost and the Dreadful Eight#10264

Grandpa Frost and the Dreadful Eight

1 second
256 megabytes
Easy

Grandpa Frost has chosen a positive integer .

Your task is to determine if it's possible to rearrange the digits of this number to form a multiple of . The rearranged number must not have leading zeros, meaning no zeros should appear before the first non-zero digit.

Input

The input consists of a single line containing the integer (1 \le n \le 10^{10^4}).

Output

If it's impossible to rearrange the digits of to form a multiple of , output the integer .

If it is possible, output any number that is a multiple of and can be formed by rearranging the digits of . If there are multiple valid solutions, you may output any one of them.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading