a,b = map(int,input().split()) r = [0]*1000 for i in range(a+1): for j in range(b+1): r[i+5*j] = 1 for i in range(1,1000): if r[i]: print(i)