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