Under construction

Still being built. Things may change

Alf and the Chalkboard

Interview

Time limit2sMemory limit1024 MB

Summary
Starting from n, each minute adds the number's last digit to it. Find the number on the board after k minutes.
Level

Easy3 of 10

Topics
Simulation, Math
Solved
No attempts yet

Statement

Alf saw a classroom chalkboard for the first time in his life. He realized he could write whatever he wanted on it with chalk, then erase it and write something new.

Alf wrote a number nn on the board. Then he decided to have some fun. Every minute he adds the last digit of the current number to it, erases the old number, and writes the new one. Alf got tired quickly, but he is very curious, so he wants to know which number he would have written after kk minutes.

Help Alf. Otherwise he will be disappointed.

Input

A single line contains two integers nn and kk (0≤n,k≤1090 \le n, k \le 10^9), the starting number and the number of minutes.

Output

Print one number xx, the number on the board after kk minutes.

Examples2

  1. Example 1

    Input
    1 10
    
    Expected output
    44
    
  2. Example 2

    Input
    5 1
    
    Expected output
    10