class Saifu: def __init__(self, yen: int) -> None: self.yukichi = yen // 10000 yen %= 10000 self.ichiyo = yen // 5000 yen %= 5000 self.hideyo = yen // 1000 yen %= 1000 self.fh = yen // 500 yen %= 500 self.oh = yen // 100 def main(): C, Y = map(int, input().split()) fh = Y // 500 oh = (Y % 500) // 100 if oh >= C: print("no exchange") return if oh + fh * 5 < C: print("can't exchange") return print(((C + 4) // 5) * 5) if __name__ == "__main__": main()