a,b=map(int,input().split()) ans=[] for i in range(a+1): for j in range(b+1): tmp=1*i+5*j if tmp!=0: ans.append(tmp) ans.sort() ans=set(ans) ans=list(ans) for i in range (len(ans)): print(ans[i])