A,B = map(int, input().split()) l = [] for i in range(A + 1): for j in range(B + 1): l.append(i + 5 * j) s = set(l) for k in sorted(s): print(k)