def label2int(ch):
    asciiVal = ord(ch)
    if (asciiVal <= 57):  # 0-9
        asciiVal -= 48
    elif (asciiVal <= 90):  # A-Z
        asciiVal -= 55
    else:  # a-z
        asciiVal -= 61
    return asciiVal


def int2label(i):
    if (i <= 9):  # 0-9
        i += 48
    elif (i <= 35):  # A-Z
        i += 55
    else:  # a-z
        i += 61
    return chr(i)

