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