#include <bits/stdc++.h>
using namespace std;
struct node{
string a,b;
}c[105];
string down[105];
string same[105];
string up[105];
int t;
bool cmp(node a,node b){
return a.a>b.a;
}
int main(){
cin >> t;
int n = t;
while(t--){
cin >> c[t].a;
cin >> c[t].b;
}
sort(c,c+n,cmp);
for(int i = 0; i < n; i++){
if(c[i].b == "DOWN"){
cout << c[i].a << endl;
}
}
for(int i = 0; i < n; i++){
if(c[i].b == "SAME"){
cout << c[i].a << endl;
}
}
for(int i = 0; i < n; i++){
if(c[i].b == "UP"){
cout << c[i].a << endl;
}
}
return 0;
}
P1159 排行榜
最新推荐文章于 2024-09-12 13:19:42 发布