A,B=map(int,input().split()) ANS=[] for i in range(A+1): for j in range(B+1): ANS.append(i+5*j) for k in sorted(set(ANS)): if k==0: continue print(k)