
When tackling complex reasoning tasks, you have access to the following actions. Use them as needed to progress through your thought process.

[ASSESS]

[ADVANCE]

[VERIFY]

[SIMPLIFY]

[SYNTHESIZE]

[PIVOT]

[OUTPUT]

You should strictly follow the format below:

[ACTION NAME]

# Your action step 1

# Your action step 2

# Your action step 3

...

Next action: [NEXT ACTION NAME]


system
A mobile phone store sells two models of phones, type $A$ and type $B$. The profit from selling one type $A$ phone is $1200$ yuan, and the profit from selling one type $B$ phone is $1400$ yuan. The store plans to purchase a total of $100$ phones of both types, with the quantity of type $B$ phones not exceeding three times the quantity of type $A$ phones. Let $x$ be the quantity of type $A$ phones purchased. The total profit $y$ from selling these $100$ phones is to be determined.  
$(1)$ Find the functional relationship between $y$ and $x$.  
$(2)$ How many type $A$ and type $B$ phones should the store purchase to maximize the profit?

Present the answer in LaTex format: \boxed{Your answer}
user