def add(self, key):
    if (key not in self.map):
        end = self.end
        curr = end[PREV]
        curr[NEXT] = end[PREV] = self.map[key] = [key, curr, end]
def add(self, key):
    if (key not in self.map):
        end = self.end
        curr = end[PREV]
        curr[NEXT] = end[PREV] = self.map[key] = [key, curr, end]