a,b=map(int,input().split()) s=set() for i in range(1,a+1): for j in range(0,5*(b+1),5): if i+j>0:s.add(i+j) s=sorted(s) for j in s: print(j)