#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main() {
	// your code goes here
	
	int n;
	cin>> n;
	
	vector<int> ml(n,0), fl(n,0);
	
	for(int i=0; i<n; i++){
		cin>>ml[i];
	}
	for(int i=0; i<n; i++){
		cin>>fl[i];
	}
	
	sort(ml.begin(), ml.end(), greater<int>());
	sort(fl.begin(), fl.end());
	
	int ptrm=0,ptrf=0;
	
	for(int i=0; i<n; i++){
		cout<<ml[i]<<" "<<fl[i]<<endl;
	}
	
	return 0;
}