a,b = map(int,input().split()) na=[0] nb=[0] ans=set() for i in range(1,a+1): na.append(i) for i in range(1,b+1): nb.append(i) for i in range(len(na)): for j in range(len(nb)): ans.add(na[i]*1 + nb[j]*5) ans=sorted(list(ans)) for i in ans: if 0 < i: print(i)