a, b = map(int, input().split()) x = sorted([i + 5 * j for i in range(a + 1) for j in range(b + 1)]) n = len(x) for i in range(1, n): if x[i - 1] != x[i]: print(x[i])