a, b = map(int, input().split()) lst = [] for i in range(a + 1): for j in range(b + 1): if i == j == 0: continue lst.append(i + j * 5) lst.sort() before = -1 for num in lst: if num == before: continue print(num) before = num