A,B = map(int,input().split()) a = 5 * B + A + 1 for v in range(1,a): if A > 4: print(v) else: if v % 5 <= A: print(v)