import typing


def atoi(text: str) -> typing.Union[int, str]:
    """returns numeric representation of text if possible else original text

    Parameters
    ----------
    text: str
        text whose numeric representation is needed

    Returns
    -------
    typing.Union[int, str]
        the integer representation of the number if possible else the original text
    """
    return int(text) if text.isdigit() else text