#include <bits/stdc++.h>
using namespace std;
bool compare(int a,int b)
{
return a>b;
}
int main()
{
vector v;
int n;
cin>>n;
for(int i=0;i<n;i++)
{
int temp;
cin>>temp;
v.push_back(temp);
}
sort(v.begin(),v.end(),compare); //sort(v.rbegin(),v.rend())
for(int i=0;i<n;i++)
cout<<v[i]<<" ";
cout<<"\n";
v.pop_back();
for(int i=0;i<n;i++)
cout<<v[i]<<" ";
cout<<"\n";
}
in this no change in output