def changeValueAtIndex(num, idx, value):
    if (len(idx) == 5):
        num[idx[0]][idx[1]][idx[2]][idx[3]][idx[4]] += value
    elif (len(idx) == 4):
        num[idx[0]][idx[1]][idx[2]][idx[3]] += value
    elif (len(idx) == 3):
        num[idx[0]][idx[1]][idx[2]] += value
    elif (len(idx) == 2):
        num[idx[0]][idx[1]] += value
    elif (len(idx) == 1):
        num[idx[0]] += value
    return num
def changeValueAtIndex(num, idx, value):
    if (len(idx) == 5):
        num[idx[0]][idx[1]][idx[2]][idx[3]][idx[4]] += value
    elif (len(idx) == 4):
        num[idx[0]][idx[1]][idx[2]][idx[3]] += value
    elif (len(idx) == 3):
        num[idx[0]][idx[1]][idx[2]] += value
    elif (len(idx) == 2):
        num[idx[0]][idx[1]] += value
    elif (len(idx) == 1):
        num[idx[0]] += value
    return num