#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int main() {
int p[3]={0,};
vector <pair<int,string>> kn(3);
for (int i = 0;i < 3;i++) {
cin >> kn[i].first >> p[i] >> kn[i].second;
p[i] = p[i] % 100;
}
sort(p,p+3);
sort(kn.begin(),kn.end(),greater<>());
cout << p[0] << p[1] << p[2] << "\n";
cout << kn[0].second[0] << kn[1].second[0] << kn[2].second[0];
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: