def getTumorStage(T, N, M):

    print " WARNING ... this function should NOT be called ... "
    sys.exit(-1)

    T = T.upper()
    N = N.upper()
    M = M.upper()

    if (M == "M1"):
        # Seems to be TCGA choice if IVA, IVB not specified
        return ("STAGE IV")
    if (M == "M1A"):
        return ("STAGE IVA")
    if (M == "M1B"):
        return ("STAGE IVB")

    if (T == "TX"):
        T = "NA"
    if (N == "NX"):
        N = "NA"
    if (M == "MX"):
        M = "NA"

    if (T == "NA" or N == "NA" or M == "NA"):
        return ("NA")

    if (T == "T0" and N == "N0" and M == "M0"):
        return ("STAGE 0")
    if (T == "Tis" and N == "N0" and M == "M0"):
        return ("STAGE 0")

    if (T == "T1" and N == "N0" and M == "M0"):
        return ("STAGE I")
    if (T == "T1A" and N == "N0" and M == "M0"):
        return ("STAGE I")
    if (T == "T1B" and N == "N0" and M == "M0"):
        return ("STAGE I")
    if (T == "T2" and N == "N0" and M == "M0"):
        return ("STAGE I")
    if (T == "T2A" and N == "N0" and M == "M0"):
        return ("STAGE I")
    if (T == "T2B" and N == "N0" and M == "M0"):
        return ("STAGE I")

    if (T == "T3" and N == "N0" and M == "M0"):
        return ("STAGE IIA")
    if (T == "T3A" and N == "N0" and M == "M0"):
        return ("STAGE IIA")
    if (T == "T3B" and N == "N0" and M == "M0"):
        return ("STAGE IIB")
    if (T == "T3C" and N == "N0" and M == "M0"):
        return ("STAGE IIB")
    if (T == "T4A" and N == "N0" and M == "M0"):
        return ("STAGE IIB")
    if (T == "T4B" and N == "N0" and M == "M0"):
        return ("STAGE IIC")
    if (T == "T4" and N == "N0" and M == "M0"):
        return (["STAGE IIB", "STAGE IIC"])

    if (T == "T1" and N == "N1" and M == "M0"):
        return ("STAGE IIIA")
    if (T == "T1A" and N == "N1" and M == "M0"):
        return ("STAGE IIIA")
    if (T == "T1B" and N == "N1" and M == "M0"):
        return ("STAGE IIIA")
    if (T == "T1" and N == "N1A" and M == "M0"):
        return ("STAGE IIIA")
    if (T == "T1" and N == "N1B" and M == "M0"):
        return ("STAGE IIIA")
    if (T == "T1" and N == "N1C" and M == "M0"):
        return ("STAGE IIIA")

    if (T == "T1" and N == "N2" and M == "M0"):
        return (["STAGE IIIA", "STAGE IIIB"])  # CHOICE IIIA, IIIB
    if (T == "T1B" and N == "N2" and M == "M0"):
        return ("STAGE IIIB")
    if (T == "T1" and N == "N2A" and M == "M0"):
        return ("STAGE IIIA")
    if (T == "T1" and N == "N3" and M == "M0"):
        return ("STAGE IIIA")
    if (T == "T2" and N == "N1" and M == "M0"):
        return ("STAGE IIIA")
    if (T == "T2A" and N == "N1" and M == "M0"):
        return ("STAGE IIIA")
    if (T == "T2B" and N == "N1" and M == "M0"):
        return ("STAGE IIIA")
    if (T == "T2" and N == "N1A" and M == "M0"):
        return ("STAGE IIIA")
    if (T == "T2" and N == "N1B" and M == "M0"):
        return ("STAGE IIIA")
    if (T == "T2" and N == "N1C" and M == "M0"):
        return ("STAGE IIIA")

    if (T == "T3" and N == "N1" and M == "M0"):
        return ("STAGE IIIB")
    if (T == "T3A" and N == "N1" and M == "M0"):
        return ("STAGE IIIB")
    if (T == "T3B" and N == "N1" and M == "M0"):
        return ("STAGE IIIB")
    if (T == "T3" and N == "N1A" and M == "M0"):
        return ("STAGE IIIB")
    if (T == "T3" and N == "N1B" and M == "M0"):
        return ("STAGE IIIB")
    if (T == "T3" and N == "N1C" and M == "M0"):
        return ("STAGE IIIB")
    if (T == "T4A" and N == "N1" and M == "M0"):
        return ("STAGE IIIB")
    if (T == "T4A" and N == "N1A" and M == "M0"):
        return ("STAGE IIIB")
    if (T == "T4A" and N == "N1B" and M == "M0"):
        return ("STAGE IIIB")
    if (T == "T4A" and N == "N1C" and M == "M0"):
        return ("STAGE IIIB")
    if (T == "T4" and N == "N1" and M == "M0"):
        return (["STAGE IIIB", "STAGE IIIC"])
    if (T == "T2" and N == "N2" and M == "M0"):
        return ("STAGE IIIB")
    if (T == "T2A" and N == "N2" and M == "M0"):
        return ("STAGE IIIB")
    if (T == "T2B" and N == "N2" and M == "M0"):
        return ("STAGE IIIB")
    if (T == "T2" and N == "N2A" and M == "M0"):
        return ("STAGE IIIB")
    if (T == "T2" and N == "N2B" and M == "M0"):
        return ("STAGE IIIB")
    if (T == "T2" and N == "N2C" and M == "M0"):
        return ("STAGE IIIC")
    if (T == "T2" and N == "N3" and M == "M0"):
        return ("STAGE IIIC")
    if (T == "T2B" and N == "N3" and M == "M0"):
        return ("STAGE IIIC")
    if (T == "T3" and N == "N2" and M == "M0"):
        return (["STAGE IIIB", "STAGE IIIC"])  # CHOICE IIIB, IIIC
    if (T == "T3" and N == "N2A" and M == "M0"):
        return ("STAGE IIIB")
    if (T == "T3" and N == "N2C" and M == "M0"):
        return ("STAGE IIIC")
    if (T == "T1" and N == "N2B" and M == "M0"):
        return ("STAGE IIIB")

    if (T == "T3" and N == "N2B" and M == "M0"):
        return ("STAGE IIIC")
    if (T == "T3" and N == "N3" and M == "M0"):
        return ("STAGE IIIC")
    if (T == "T4" and N == "N2" and M == "M0"):
        return ("STAGE IIIC")
    if (T == "T4A" and N == "N2" and M == "M0"):
        return ("STAGE IIIC")
    if (T == "T4A" and N == "N2A" and M == "M0"):
        return ("STAGE IIIC")
    if (T == "T4A" and N == "N2B" and M == "M0"):
        return ("STAGE IIIC")
    if (T == "T4A" and N == "N2C" and M == "M0"):
        return ("STAGE IIIC")
    if (T == "T4" and N == "N3" and M == "M0"):
        return ("STAGE IIIC")
    if (T == "T4" and N == "N3A" and M == "M0"):
        return ("STAGE IIIC")
    if (T == "T4A" and N == "N3" and M == "M0"):
        return ("STAGE IIIC")
    if (T == "T4B" and N == "N1" and M == "M0"):
        return ("STAGE IIIC")
    if (T == "T4B" and N == "N2" and M == "M0"):
        return ("STAGE IIIC")
    if (T == "T4B" and N == "N1A" and M == "M0"):
        return ("STAGE IIIC")
    if (T == "T4B" and N == "N1B" and M == "M0"):
        return ("STAGE IIIC")
    if (T == "T4B" and N == "N1C" and M == "M0"):
        return ("STAGE IIIC")
    if (T == "T4B" and N == "N2C" and M == "M0"):
        return ("STAGE IIIC")
    if (T == "T4B" and N == "N2A" and M == "M0"):
        return ("STAGE IIIC")
    if (T == "T4B" and N == "N2B" and M == "M0"):
        return ("STAGE IIIC")
    if (T == "T4B" and N == "N2B" and M == "M0"):
        return ("STAGE IIIC")
    if (T == "T4B" and N == "N3A" and M == "M0"):
        return ("STAGE IIIC")

    # We reach this point if all values are non-NA, but combination is not in
    # AJCC tumor table
    print " ERROR in getTumorStage ??? ", T, N, M
    return ("Not in AJCC Table?")

    sys.exit(-1)