class Solution:
def mergeSimilarItems(self, items1: List[List[int]], items2: List[List[int]]) -> List[List[int]]:
map=Counter()
for a,b in items1:
map[a]+=b
for a,b in items2:
map[a]+=b
return sorted([a,b] for a,b in map.items())