To solve this optimization problem, we first need to define the decision variables and the objective function. Let's denote:

- $x_1$ as the number of sports ad commercials purchased.
- $x_2$ as the number of TV show commercials purchased.

The objective is to minimize the total cost of the advertisements, which can be represented as $90,000x_1 + 20,000x_2$.

We have constraints based on the requirements to reach at least 40 million baby boomers and 25 million millennials. The constraints can be formulated as follows:

- For reaching baby boomers: $4x_1 + 12x_2 \geq 40$
- For reaching millennials: $18x_1 + 5x_2 \geq 25$

Additionally, since we cannot purchase a negative number of ads, both $x_1$ and $x_2$ must be non-negative.

Now, let's translate this problem into Gurobi code in Python:

```python
from gurobipy import *

# Create a new model
m = Model("Matter_Auto_Advertising")

# Define the decision variables
x1 = m.addVar(vtype=GRB.CONTINUOUS, name="sports_ads", lb=0)
x2 = m.addVar(vtype=GRB.CONTINUOUS, name="tv_show_ads", lb=0)

# Set the objective function to minimize cost
m.setObjective(90000*x1 + 20000*x2, GRB.MINIMIZE)

# Add constraints for reaching baby boomers and millennials
m.addConstr(4*x1 + 12*x2 >= 40, name="baby_boomers")
m.addConstr(18*x1 + 5*x2 >= 25, name="millennials")

# Optimize the model
m.optimize()

# Print out the results
if m.status == GRB.OPTIMAL:
    print("Optimal solution found:")
    print(f"Purchase {x1.x} sports ads")
    print(f"Purchase {x2.x} TV show ads")
    print(f"Total cost: ${m.objVal}")
else:
    print("No optimal solution found")
```