#include <vector>
#include <algorithm>
#include <iostream>

using namespace std;

int main() {
    vector<pair<string, string>> v{{"b", "d"}, {"d", "g"}, {"a", "z"}};
    sort(v.begin(), v.end());

    for (auto x : v) cout << x.first << " " << x.second << endl;
    }
