a,b = map(int,input().split()) table = [] for i in range(a+1): for j in range(b+1): tot = 1*i + 5*j table.append(tot) table = list(set(table)) table.sort() table = table[1:] for i in table: print(i)