#include #include #include #include int main() { int N; std::cin >> N; std::vector> books(N); for (auto& b : books) std::cin >> b.first >> b.second; std::sort(books.begin(), books.end()); for (auto b : books) { std::cout << b.first << " " << b.second << std::endl; } }