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