a, b = map(int, input().split()) result = [] for i in range(a+1): for j in range(b+1): f = i + j * 5 if f in result: pass else: result.append(i + j * 5) result.sort() for k in result[1:]: print(k)