#include #include #include #include #include using namespace std; using P = pair; int main() { int N; cin >> N; vector

strs(N); for (int i = 0; i < N; i++) { string str1, str2; cin >> str1 >> str2; strs[i] = P(str1, str2); } sort(strs.begin(), strs.end()); for (P str : strs) cout << str.first + " " + str.second << endl; }