Below is an context that describes a sql query, paired with an question that provides further information. Write an answer that appropriately completes the request.  # noqa: E501
### Context:
CREATE TABLE table_name_50 (runs_allowed INTEGER, rank VARCHAR, losses VARCHAR)
### Question:
How many runs allowed did the team ranked 2 with more than 2 losses have?
### Answer:
SELECT AVG(runs_allowed) FROM table_name_50 WHERE rank = 2 AND losses > 2