a,b = map(int, raw_input().split()) for i in range(b+1): if i == 0: s = 1 else: s = 0 if i == b: e = a else: e = min(4,a) for j in range(s,e+1): print i*5 + j