#include <iostream>
using namespace std;
int main() {
int n, v[11], w[11];
cin >> n;
for (int i = 1; i <= n; ++i) {
cin >> v[i];
}
for (int i = 1; i <= n; ++i) {
cin >> w[i];
}
int m = n;
bool sorted;
do {
sorted = true;
for (int i = 1; i < m; i++)
if (w[i] < w[i + 1]) {
int aux = w[i];
w[i] = w[i + 1];
w[i + 1] = aux;
sorted = false;
}
m--;
} while (!sorted);
for (int i = 1; i <= n; ++i) {
cout << w[i] << " ";
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglpbnQgbiwgdlsxMV0sIHdbMTFdOwoJY2luID4+IG47Cglmb3IgKGludCBpID0gMTsgaSA8PSBuOyArK2kpIHsKCQljaW4gPj4gdltpXTsKCX0KCWZvciAoaW50IGkgPSAxOyBpIDw9IG47ICsraSkgewoJCWNpbiA+PiB3W2ldOwoJfQoJaW50IG0gPSBuOwoJYm9vbCBzb3J0ZWQ7CglkbyB7CgkgICAgc29ydGVkID0gdHJ1ZTsKCSAgICBmb3IgKGludCBpID0gMTsgaSA8IG07IGkrKykKCSAgICAgICAgaWYgKHdbaV0gPCB3W2kgKyAxXSkgewoJICAgICAgICAgICAgaW50IGF1eCA9IHdbaV07CgkgICAgICAgICAgICB3W2ldID0gd1tpICsgMV07CgkgICAgICAgICAgICB3W2kgKyAxXSA9IGF1eDsKCSAgICAgICAgICAgIHNvcnRlZCA9IGZhbHNlOwoJICAgICAgICB9CgkgICAgbS0tOwoJfSB3aGlsZSAoIXNvcnRlZCk7Cglmb3IgKGludCBpID0gMTsgaSA8PSBuOyArK2kpIHsKCQljb3V0IDw8IHdbaV0gPDwgIiAiOwoJfQoJcmV0dXJuIDA7Cn0=