def METHOD_NAME(qstr):
    import string
    s = qstr.split(' ')
    retval = []
    nextGood = 0
    idType = 0
    for token in s:
        if token == "(zone" or token == "(cell":
            idType = 1
            nextGood = 1
            continue
        elif token == "(node":
            idType = 0
            nextGood = 1
            continue
        if nextGood == 1:
            nextGood = 0
            retval = retval + [(idType, int(token))]
    return retval