a,b = map(int,input().split()) SET = set(i+j*5 for j in range(b+1) for i in range(a+1)) L = sorted(list(SET)) print(*L[1:], sep="\n")