from typing import Union


def parse_num_to_int(string: str) -> Union[int, str]:
    """Convert string numbers to int, leaving strings as is."""
    try:
        return int(string)
    except ValueError:
        return string