def pin2name(id: int) ->str:
    """Convert pin number to name"""
    if not isinstance(id, int):
        raise TypeError('id must be a non-negative integer')
    if id < 0:
        raise ValueError('id must be a non-negative integer')
    ports = 'ABCDEFGHIJKL'
    port_num = id // 32
    pin_num = id - port_num * 32
    if pin_num >= 32:
        raise ValueError('id out of range')
    try:
        return 'P{}{}'.format(ports[port_num], pin_num)
    except IndexError:
        raise ValueError('id out of range')
