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