Polycarp urgently needs a shovel! He comes to the shop and chooses an appropriate one. The shovel that Policarp chooses is sold for k burles. Assume that there is an unlimited number of such shovels in the shop.

In his pocket Polycarp has an unlimited number of "10-burle coins" and exactly one coin of r burles (1 ≤ r ≤ 9).

What is the minimum number of shovels Polycarp has to buy so that he can pay for the purchase without any change? It is obvious that he can pay for 10 shovels without any change (by paying the requied amount of 10-burle coins and not using the coin of r burles). But perhaps he can buy fewer shovels and pay without any change. Note that Polycarp should buy at least one shovel.


-----Input-----

The single line of input contains two integers k and r (1 ≤ k ≤ 1000, 1 ≤ r ≤ 9) — the price of one shovel and the denomination of the coin in Polycarp's pocket that is different from "10-burle coins". 

Remember that he has an unlimited number of coins in the denomination of 10, that is, Polycarp has enough money to buy any number of shovels.


-----Output-----

Print the required minimum number of shovels Polycarp has to buy so that he can pay for them without any change. 


-----Examples-----
Input
117 3

Output
9

Input
237 7

Output
1

Input
15 2

Output
2



-----Note-----

In the first example Polycarp can buy 9 shovels and pay 9·117 = 1053 burles. Indeed, he can pay this sum by using 10-burle coins and one 3-burle coin. He can't buy fewer shovels without any change.

In the second example it is enough for Polycarp to buy one shovel.

In the third example Polycarp should buy two shovels and pay 2·15 = 30 burles. It is obvious that he can pay this sum without any change.

Difficulty: interview

Starter code:

Solutions:
k, r = list(map(int, input().split()))

ans = 10
for x in range(1, 11):
    mod = k * x % 10
    if mod == 0 or mod == r:
        ans = x
        break

print(ans)


k,r = list(map(int, input().split()))
e = 1
j = 1
while e > 0:
    e = min((j*k-r) % 10, j*k % 10)
    j += 1
print(j-1)


def solve():
	k, r = map(int, input().split())
	for i in range(1, 11):
		if i * k % 10 == r or i * k % 10 == 0:
			return i

print(solve())

n, r = map(int, input().split())
for i in range(1, 200):
    if ((i * n) % 10 == r or (i * n) % 10 == 0):
        print(i)
        break

k, r = list(map(int, input().split()))
i = 1
while k * i % 10 != r and k * i % 10 != 0:
	i += 1
if k * i % 10 == 0:
	print(i)
else:
	print(i)


k, r = map(int, input().split())
ans = 1
while ((ans * k) % 10 != r) and ((ans * k) % 10 != 0):
	ans += 1
print(ans)

k,r=list(map(int,input().split()))
for i in range(1,11):
    if (k*i)%10==r or (k*i)%10==0:
        print(i)
        break


from sys import stdin

k, r = list(map(int, stdin.readline().split()))

for n in range(1, 10):
    if (n * k) % 10 == r or (n * k) % 10 == 0:
        print(n)
        break
else:
    print(10)


import sys, math, random
n, m = list(map(int, input().split()))
i = 1
while True:
    if i * n % 10 == m or i * n % 10 == 0:
        print(i)
        return
    i += 1
    


n, r = map(int, input().split())
for i in range(1, 11):
    if (n * i) % 10 == 0 or (n * i) % 10 == r:
        print(i)
        return

s = input().split(' ')
k = int(s[0])
r = int(s[1])

count = 1
while True:
    if k * count % 10 == 0 or k * count % 10 == r:
        break
    count += 1

print(count)


k, r = map(int, input().split())
num = k
counter = 1
while num % 10 not in [r, 0]:
    num += k
    counter += 1
print(counter)

n,m = (int(i) for i in input().split())
ans = 10
for i in range(1,10):
    if (n*i-m)%10 == 0 or (n*i)%10 == 0:
        ans = min(ans,i)
print(ans)

n, k = list(map(int, input().split()))
for i in range(1, 11):
    if ((n * i) % 10 == 0 or n * i % 10 == k):
        print(i)
        break


k, r = list(map(int, input().split()))
for i in range(1, 11):
	if k * i % 10 in (0, r):
		print(i)
		break


k, r = [int(x) for x in input().split()]
ans = 0
for i in range(10):
    i = i + 1
    if (i*k)%10 == 0 or (i*k)%10 == r:
        ans = i
        break
print(ans)


K, R = ( int(x) for x in input().split() )
a = K%10
cost = 0
val = 10
for i in range(1,11):
	cost += a
	if cost%10 in [0,R]:
		val = i
		break

print(val)

n, r = list(map(int, input().split()))
i = 1
m = n
while m % 10 != r and m % 10 != 0:
    m += n
    i += 1
print(i)

d=input().split()
k=int(d[0])
r=int(d[1])
for i in range(1,11):
    if (k*i-r)%10==0 or (k*i)%10==0:
        print(i)
        break


k, r = map(int, input().split())
cnt = 1
while True:
	if (k * cnt) % 10 == r or (k * cnt) % 10 == 0:
		print(cnt)
		break
	else:
		cnt += 1

k, r = map(int, input().split())
ans = 1
c = k
while k % 10 != 0 and (k - r) % 10 != 0:
    ans += 1
    k += c
print(ans)

k, r = map(int, input().split())
i = 1
while True:
    if ((k * i - r) % 10 == 0) or (k * i % 10 == 0):
        print(i)
        break
    i += 1

k,r=list(map(int,input().split()))
x=k
ans=1
while x%10!=r and x%10!=0:
    x+=k
    ans+=1
print(ans)


k,r = map(int,input().split())
for j in range(1, 11):
    if (j * k) % 10 == 0 or (j*k) % 10 == r:
        print(j)
        break

k, r = list(map(int,input().split()))

for a in range(1, 11):
    price = (k*a)%10
    if price == r or price == 0:
        print(a)
        break