#include #include #include #include #include #include int main() { using namespace boost::bimaps; typedef bimap, list_of > count_map; std::ios::sync_with_stdio(false); std::string str; count_map count; while (std::cin >> str) ++count.left[str]; count.right.sort(std::greater_equal()); typedef count_map::right_const_iterator it; for (it i(count.right.begin()), e(count.right.end()); i != e; ++i) std::cout << i->first << ' ' << i->second << std::endl; }