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 = table[1:] table.sort() table = set(table) for i in table: print(i)