A, B = map(int, input().split()) S = set() for a in range(A + 1): for b in range(B + 1): S.add(a + 5 * b) for a in sorted(list(S))[1:]: print(a)