a, b = map(int, input().split()) l = [] for i in range(a+1): for j in range(b+1): l.append(1*i + 5*j) l = sorted(set(l)) del l[0] print('\n'.join(map(str, l)))