n,m = map(int,input().split()) a = list(range(1,n+1)) b = [5*x for x in range(1,m+1)] l = set(a+b) for i in a: for j in b: l.add(i+j) l = sorted(list(l)) for t in l: print(t)