A, B = [int(i) for i in input().split()] for i in sorted(list(set(coin1 + coin5*5 for coin1 in range(0, A+1) for coin5 in range(0, B+1)))): if i == 0: continue print(i)