#include
#include
#include
#include
#include
using namespace std;
map sort_by_key(const string& path) {
map box;
ifstream inp(path);
if (inp.is_open()) {
int key{}, value{};
string a, b, c;
while (inp >> key >> a >> b >> value >> c) {
box[key] = value;
}
}
return box;
}
map sort_by_value(const string& path) {
map box;
ifstream inp(path);
if (inp.is_open()) {
int key{}, value{};
string a, b, c;
while (inp >> key >> a >> b >> value >> c) {
box[value] = key;
}
}
return box;
}
int main() {
auto keys = sort_by_key("list.txt");
for (const auto& [key, value] : keys) {
cout