def chord_sort_key(ch):
    """
    >>> chord_sort_key("Abmaj7")
    ['A', -1, 0, 'maj7']
    >>> chord_sort_key('Gm')
    ['G', 0, 1, '']
    >>> chord_sort_key('Esharpsus4')
    ['E', 1, 0, 'sus4']
    >>> chord_sort_key('G7sus4')
    ['G', 0, 0, '7sus4']
    """
    # base note
    key = [ch[0]]
    i = 1

    # flat / natural / sharp
    if i < len(ch) and ch[i] == "b":
        key.append(-1)
        i += 1
    elif ch[i:].startswith("sharp"):
        key.append(1)
        i += 5
    else:
        key.append(0)


    # major / minor
    if i < len(ch) and ch[i] == "m" and not ch[i:].startswith("maj"):
        key.append(1)
        i += 1
    else:
        key.append(0)

    # the rest
    key.append(ch[i:])

    return key