#include <iostream>
#include <vector>
#include <cstdlib>
using namespace std;

int compare(const void *a, const void *b) {
    int x = ((pair<int,int>*)a)->first;
    int y = ((pair<int,int>*)b)->first;
    return x - y;
}


int main() {

    int m = 3;

    vector<pair<int, int>> weight(m);

    weight[0].first = 3;
    weight[0].second = 0;

    weight[1].first = 2;
    weight[1].second = 5;

    weight[2].first = 1;
    weight[2].second = 6;

    for (int i = 0; i < m; i++) {
        cout << weight[i].first << " " << weight[i].second << endl;
    }

    cout << endl;

    qsort(&weight[0].first, m, sizeof(weight[0]), compare);

    for (int i = 0; i < m; i++) {
        cout << weight[i].first << " " << weight[i].second << endl;
    }



    return 0;
}

