#include <cstdio>
#include <vector>
#include <algorithm>

using namespace std;

const int N = 10;

int a[N] = {1, 2, 3};
vector<int> b(N);

bool f( int i, int j ) {
	return i > j;
}

struct comparator {
	int x;
	bool operator() ( int i, int j ) {
		return i * x < j * x;
	}
};

void out() {
	for (int i = 0; i < N; i++) printf("%d%c", a[i], " \n"[i == N - 1]);
}

int main() {
	sort(b.begin(), b.end());
	
	sort(a, a + N);
	
	sort(a, a + N, f);
	out();
	sort(a, a + N, comparator {1});
	out();
	sort(a, a + N, comparator {-1});
	out();
}