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