You are an expert Python programmer.
Write a Python code that defines a function named `solve` which takes one argument:
- a list of tuples (key, value), where key is an integer and value is a string.
The code must:
- return the list sorted by key in ascending order,
- sorting must be stable (preserve original order for equal keys),
- raise a TypeError if input elements are not tuples of (int, str),
- not import external libraries unless strictly required.
Important formatting rules:
- Output only valid Python function code, nothing else.
- Enclose the code between <python_code> and </python_code> tags.
- Do not add explanations, comments, or test case.
