Write a Python program optimize the following code using functional programming.
i = 5
while i >= 0:
 print(i)
 i -= 1
from functools import reduce

# initialize the loop
num = 5

# call reduce()
solution = reduce(lambda i, _: i - 1, range(num + 1))

# print the result
print(solution)