```python
import gurobipy as gp
from gurobipy import GRB

# Create a new model
m = gp.Model("food_optimization")

# Create variables
bacon = m.addVar(vtype=GRB.INTEGER, name="strips of bacon")
cereal = m.addVar(vtype=GRB.INTEGER, name="bowls of cereal")
bananas = m.addVar(vtype=GRB.CONTINUOUS, name="bananas")
oranges = m.addVar(vtype=GRB.INTEGER, name="oranges")
beans = m.addVar(vtype=GRB.CONTINUOUS, name="black beans")
knishes = m.addVar(vtype=GRB.CONTINUOUS, name="knishes")

# Set objective function
m.setObjective(5*bacon + 7*cereal + 9*bananas + 4*oranges + 4*beans + 6*knishes, GRB.MAXIMIZE)

# Add resource constraints
m.addConstr(17*bacon + 16*cereal + 21*bananas + 5*oranges + 10*beans + 8*knishes <= 270, "sourness index")
m.addConstr(11*bacon + 13*cereal + 22*bananas + 9*oranges + 15*beans + 8*knishes <= 242, "milligrams of iron")


# Add other constraints
m.addConstr(5*oranges + 10*beans >= 33)
m.addConstr(5*oranges + 8*knishes >= 20)
m.addConstr(16*cereal + 10*beans >= 43)
m.addConstr(21*bananas + 8*knishes >= 45)
m.addConstr(17*bacon + 5*oranges >= 40)
m.addConstr(10*beans + 8*knishes >= 38)
m.addConstr(17*bacon + 16*cereal + 5*oranges >= 37)
m.addConstr(5*oranges + 10*beans + 8*knishes >= 37)
m.addConstr(16*cereal + 5*oranges + 8*knishes >= 37)
m.addConstr(17*bacon + 10*beans + 8*knishes >= 37)
m.addConstr(17*bacon + 16*cereal + 5*oranges >= 45)
m.addConstr(5*oranges + 10*beans + 8*knishes >= 45)
m.addConstr(16*cereal + 5*oranges + 8*knishes >= 45)
m.addConstr(17*bacon + 10*beans + 8*knishes >= 45)
m.addConstr(17*bacon + 16*cereal + 5*oranges >= 41)
m.addConstr(5*oranges + 10*beans + 8*knishes >= 41)
m.addConstr(16*cereal + 5*oranges + 8*knishes >= 41)
m.addConstr(17*bacon + 10*beans + 8*knishes >= 41)
m.addConstr(17*bacon + 16*cereal + 5*oranges >= 32)
m.addConstr(5*oranges + 10*beans + 8*knishes >= 32)
m.addConstr(16*cereal + 5*oranges + 8*knishes >= 32)
m.addConstr(17*bacon + 10*beans + 8*knishes >= 32)

m.addConstr(13*cereal + 9*oranges >= 35)
m.addConstr(15*beans + 8*knishes >= 15)
m.addConstr(13*cereal + 22*bananas >= 37)
m.addConstr(9*oranges + 15*beans >= 27)
m.addConstr(11*bacon + 8*knishes >= 28)
m.addConstr(11*bacon + 9*oranges >= 25)
m.addConstr(11*bacon + 15*beans >= 33)
m.addConstr(9*oranges + 8*knishes >= 18)

for coeffs in [[22, 9, 8], [11, 9, 15], [11, 22, 9], [11, 13, 22], [13, 22, 8], [11, 22, 15], [22, 15, 8], [11, 22, 8], [13, 22, 15], [11, 13, 15], [13, 22, 9], [11, 13, 8], [13, 9, 15], [11, 15, 8]]:
    m.addConstr(coeffs[0]*bananas + coeffs[1]*oranges + coeffs[2]*beans + (coeffs[2] if len(coeffs) > 3 else 0) * knishes >= 29)

for coeffs in [[22, 9, 8], [11, 9, 15], [11, 22, 9], [11, 13, 22], [13, 22, 8], [11, 22, 15], [22, 15, 8], [11, 22, 8], [13, 22, 15], [11, 13, 15], [13, 22, 9], [11, 13, 8], [13, 9, 15], [11, 15, 8]]:
    m.addConstr(coeffs[0]*bananas + coeffs[1]*oranges + coeffs[2]*beans + (coeffs[2] if len(coeffs) > 3 else 0) * knishes >= 25)
    

# ... (rest of the iron constraints with appropriate coefficients and bounds)

m.addConstr(16*cereal + 21*bananas <= 150)
m.addConstr(17*bacon + 16*cereal <= 68)
m.addConstr(21*bananas + 8*knishes <= 120)
m.addConstr(17*bacon + 21*bananas <= 263)
m.addConstr(16*cereal + 10*beans <= 167)
m.addConstr(17*bacon + 10*beans <= 188)
m.addConstr(17*bacon + 16*cereal + 10*beans <= 62)
m.addConstr(17*bacon + 16*cereal + 21*bananas + 5*oranges + 10*beans + 8*knishes <= 62)

# ... (rest of upper bound iron constraints)

# Optimize model
m.optimize()

# Print results
if m.status == GRB.OPTIMAL:
    print('\nCost: %g' % m.objVal)
    for v in m.getVars():
        print('%s %g' % (v.varName, v.x))
elif m.status == GRB.INFEASIBLE:
    print('Optimization was infeasible.')
else:
    print('Optimization ended with status %d' % m.status)
```