e_1,e_5 = map(int,input().split()) ans=set() for i in range(e_5+1): for j in range(e_1+1): ans.add(j + 5 * i) for i in sorted(ans)[1:]: print(i)