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