#include "assert.h"
#include <iostream>
using namespace std;
void Swappp(int &a,int &b)
{
int temp;
temp=a;
a=b;
b=temp;
}
void Sort(int a[],int n)
{
int i=0,j=0;
int k=n-1;
while(j<=k)
{
if(a[j]==1)
{
if(i!=j)
{
Swappp(a[i],a[j]);
cout<<i<<"<—>"<<j<<endl;
}
i++;
j++;
}
else if(a[j]==3)
{
if(j!=k)
{
Swappp(a[j],a[k]);
cout<<j<<"<—>"<<k<<endl;
}
k--;
}
else
j++;
}
for(int t=0; t<n; t++)
{
cout<<a[t];
}
cout<<endl;
}
int main()
{
int n;
cin >> n;
int * a= new int[n];
for (int i=0; i<n; i++)
cin>>a[i];
Sort(a,n);
}