## Problem Description and Formulation

The problem is a linear programming optimization problem. We need to maximize the profit from selling first-class and economy-class tickets on a flight.

### Decision Variables

- $x$: Number of first-class tickets sold
- $y$: Number of economy-class tickets sold

### Objective Function

The profit made on each first-class ticket is $150, and on each economy-class ticket is $350. The objective is to maximize the total profit:

Maximize: $150x + 350y$

### Constraints

1. Total tickets available: $x + y \leq 150$
2. Minimum first-class tickets: $x \geq 20$
3. Economy-class tickets preference: $y \geq 3x$ (at least 3 times as many economy-class tickets as first-class tickets)
4. Non-negativity constraints: $x \geq 0, y \geq 0$ (implicitly satisfied by the problem context)

### Gurobi Code

```python
import gurobi

def solve_flight_ticket_problem():
    # Create a new model
    model = gurobi.Model()

    # Define decision variables
    x = model.addVar(lb=0, name="first_class_tickets")
    y = model.addVar(lb=0, name="economy_class_tickets")

    # Objective function: Maximize profit
    model.setObjective(150*x + 350*y, gurobi.GRB.MAXIMIZE)

    # Constraints
    model.addConstr(x + y <= 150, name="total_tickets")
    model.addConstr(x >= 20, name="min_first_class")
    model.addConstr(y >= 3*x, name="economy_class_preference")

    # Solve the model
    model.optimize()

    # Check if the model is optimized
    if model.status == gurobi.GRB.OPTIMAL:
        print(f"Optimal solution found.")
        print(f"Number of first-class tickets to sell: {x.varValue}")
        print(f"Number of economy-class tickets to sell: {y.varValue}")
        print(f"Maximum profit: ${150*x.varValue + 350*y.varValue}")
    else:
        print("No optimal solution found.")

solve_flight_ticket_problem()
```

This code defines the optimization problem using Gurobi's Python interface, solves it, and prints out the optimal solution if one exists.