#include <map>
#include <set>
#include <string>
#include <iostream>
#include <iomanip>

int main() {
    std::map<std::string, int> m;  // Your original map.
    m["realistically"] = 1;
    m["really"]        = 8;
    m["reason"]        = 4;
    m["reasonable"]    = 3;
    m["reasonably"]    = 1;
    m["reassemble"]    = 1;
    m["reassembled"]   = 1;
    m["recognize"]     = 2;
    m["record"]        = 92;
    m["records"]       = 48;
    m["recs"]          = 7;

    std::set<std::pair<int, std::string>> s;  // The new (temporary) container.

    for (auto const &kv : m)
        s.emplace(kv.second, kv.first);  // Flip the pairs.

    for (auto const &vk : s)
        std::cout << std::setw(3) << vk.first << std::setw(15) << vk.second << std::endl;

	return 0;
}