def add_monomials(mono1, mono2):
    d = dict(mono1)
    for [k, v] in mono2:
        d[k] = d.get(k, 0)
        d[k] += v
    return list(d.items())
def add_monomials(mono1, mono2):
    d = dict(mono1)
    for [k, v] in mono2:
        d[k] = d.get(k, 0)
        d[k] += v
    return list(d.items())