/*==========================================================================*/ /* auther: Dev1ce created: 08.04.2024 21:18:22 */ /*--------------------------------------------------------------------------*/ #include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector> p; for (int i = 0; i < n; i++) { string s, t; cin >> s >> t; p.push_back(make_pair(s, t)); } sort(p.begin(), p.end()); for (auto [a, c] : p) { cout << a << " " << c << '\n'; } return 0; }