c, y = map(int,input().split()) a = [1, 5, 10, 50, 100, 500, 1000, 2000, 5000, 10000] b = [0] * len(a) for i in range(len(a)-1,-1,-1): t = y // a[i] b[i] += t y %= a[i] if b[4] >= c: print("no exchange") exit() cnt = 0 piv = len(a) - 1 while b[4] < c: if piv == 4: print("can't exchange") exit() if b[piv] == 0: piv -= 1 continue b[4] += a[piv] // 100 b[piv] -= 1 cnt += 1 print(c)