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