def METHOD_NAME(d, k, m, x, y):
    """d: {k: {m: [(x,y)]}}"""
    mt = d.get(k)
    if mt is None:
        d[k] = {m: [(x,y)]}
    else:
        klist = mt.get(m)
        if klist is None:
            mt[m] = [(x,y)]
        else:
            klist.append((x, y))