Under construction

Still being built. Things may change

Beautiful Numbers

Time limit1sMemory limit1024 MB

Level

Not classified yet

Solved
No attempts yet

Problem

Sasha calls a number beautiful if its decimal notation contains only the digits 0 and k (1 ≤ k ≤ 9). For example, if k = 2, the beautiful numbers are 2, 20, 22, 2002, and so on. Sasha does not like any other numbers, so he writes them as sums of beautiful numbers. For example, if k = 3, the number 69 can be written as 69 = 33 + 30 + 3 + 3.

Not every natural number is a sum of beautiful integers. For example, when k = 5, the number 6 cannot be written that way. But beautiful decimal fractions can be used: 6 = 5.5 + 0.5.

Sasha recently learned about repeating decimals and started using them as summands. For example, if k = 3, the number 43 can be written as 43 = 33.(3) + 3.(3) + 3 + 3.(3).

Any natural number can be written as a sum of positive beautiful numbers. The representation is not unique. For example, 69 can also be written as 69 = 33 + 33 + 3. Sasha wants to know the minimum number of summands needed to write the number n as a sum of beautiful numbers.

Write a program that, given n and k, finds a representation of n as a sum of positive beautiful numbers with the minimum number of summands.

Input

Two natural numbers n and k are given in the input file (1≤n≤1091 \le n \le 10^9; 1≤k≤91 \le k \le 9).

Output

Print a representation of n as a sum of positive numbers that contain only the digits 0 and k, using the minimum possible number of summands. The output has the form:

n=a1+a2+...+am

The summands a1, a2, ..., am must be printed without leading zeros and without redundant trailing zeros in the fractional part. Each summand must have the shortest possible pre-period and period. For example, these forms are wrong: 07.7; 2.20; 55.5(5); 0.(66); 7.(0); 7.; .5; 0.33(03). They should be printed as 7.7; 2.2; 55.(5); 0.(6); 7; 7; 0.5; 0.3(30).

The pre-period and the period of each printed number must have at most 100 digits. It is guaranteed that at least one such representation exists. If several solutions exist, print any of them. The order of the summands does not matter.

The output must not contain spaces.

Examples3

  1. Example 1

    Input
    69 3
    
    Expected output
    69 = 33 + 33 + 3
    
  2. Example 2

    Input
    6 5
    
    Expected output
    6 = 5.5 + 0.5
    
  3. Example 3

    Input
    10 9
    
    Expected output
    10 = 9.(9)