from collections import defaultdict ; from collections import namedtuple from collections import defaultdictfrom collections import namedtuple