#include <map>
#include <string>
#include <iostream>
#include <iomanip>
// for clarity:
typedef std::string word_type ;
typedef std::string tag_type;
int main()
{
std::map<word_type, std::map<tag_type, int>> wordcount;
wordcount["fly"]["V"] = 35;
wordcount["fly"]["N"] = 150;
wordcount["fill"]["V"] = 49;
wordcount["fill"]["N"] = 20;
wordcount["time"]["V"] = 19;
wordcount["time"]["N"] = 90;
for (auto& tag : wordcount)
{
std::cout << std::left << std::setw(10) << tag.first << '\n';
for (auto & count : tag.second)
{
std::cout << std::setw(10) << "";
std::cout << '[' << count.first << ']';
std::cout << std::right << std::setw(5) << count.second << '\n';
}
std::cout << '\n';
}
}
I2luY2x1ZGUgPG1hcD4KI2luY2x1ZGUgPHN0cmluZz4KI2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8aW9tYW5pcD4KCi8vIGZvciBjbGFyaXR5Ogp0eXBlZGVmIHN0ZDo6c3RyaW5nIHdvcmRfdHlwZSA7CnR5cGVkZWYgc3RkOjpzdHJpbmcgdGFnX3R5cGU7CgppbnQgbWFpbigpCnsKICAgIHN0ZDo6bWFwPHdvcmRfdHlwZSwgc3RkOjptYXA8dGFnX3R5cGUsIGludD4+IHdvcmRjb3VudDsKCiAgICB3b3JkY291bnRbImZseSJdWyJWIl0gPSAzNTsKICAgIHdvcmRjb3VudFsiZmx5Il1bIk4iXSA9IDE1MDsKCiAgICB3b3JkY291bnRbImZpbGwiXVsiViJdID0gNDk7CiAgICB3b3JkY291bnRbImZpbGwiXVsiTiJdID0gMjA7CgogICAgd29yZGNvdW50WyJ0aW1lIl1bIlYiXSA9IDE5OwogICAgd29yZGNvdW50WyJ0aW1lIl1bIk4iXSA9IDkwOwoKICAgIGZvciAoYXV0byYgdGFnIDogd29yZGNvdW50KQogICAgewogICAgICAgIHN0ZDo6Y291dCA8PCBzdGQ6OmxlZnQgPDwgc3RkOjpzZXR3KDEwKSA8PCB0YWcuZmlyc3QgPDwgJ1xuJzsKCiAgICAgICAgZm9yIChhdXRvIC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