def spanish_dni_letter(dni):
    """
    Generates spanish DNI letter
    
    :param dni: DNI numeric part
    :type dni: Numeric string or integer
    :returns: DNI letter
    :rtype: Single letter string
    """
    letters='TRWAGMYFPDXBNJZSQVHLCKE'
    return letters[int(dni[:8])%23]