AB=input() AB=AB.rstrip().split(" ") A=int(AB[0]) B=int(AB[1]) list1=[] for i in range(A+1): for j in range(B+1): if i+5*j not in list1: list1.append(i+5*j) list1.sort() for k in range(1,len(list1)): print(list1[k])