from itertools import product a, b = map(int, input().split()) one_coins = [1*n for n in range(a+1)] five_coins = [5*n for n in range(b+1)] total = set() for v in product(one_coins, five_coins): s = sum(v) if s != 0: total.add(sum(v)) for t in sorted(total): print(t)