a, b = map(int, input().split()) l = [i+5*j for i in range(a+1) for j in range(b+1) if i+5*j != 0] l = sorted(set(l)) for i in l: print(i)