import itertools a,b=map(int,input().split()) a_add=[i for i in range(1,a+1)] b_add=[s for s in range(5,(b+1)*5,5)] l = [] for x in a_add: for y in b_add: l.append((x+y)) for m in itertools.chain(a_add,b_add,l): print(m)