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