You are given a string S of length 2N, containing N occurrences of `a` and N occurrences of `b`.

You will choose some of the characters in S. Here, for each i = 1,2,...,N, it is not allowed to choose exactly one of the following two: the i-th occurrence of `a` and the i-th occurrence of `b`. (That is, you can only choose both or neither.) Then, you will concatenate the chosen characters (without changing the order).

Find the lexicographically largest string that can be obtained in this way.

Constraints

* 1 \leq N \leq 3000
* S is a string of length 2N containing N occurrences of `a` and N occurrences of `b`.

Input

Input is given from Standard Input in the following format:


N
S


Output

Print the lexicographically largest string that satisfies the condition.

Examples

Input

3
aababb


Output

abab


Input

3
bbabaa


Output

bbabaa


Input

6
bbbaabbabaaa


Output

bbbabaaa


Input

9
abbbaababaababbaba


Output

bbaababababa
#include<bits/stdc++.h>
using namespace std;
const int N=6005;
char s[N],s1[N],s2[N],ans[N];
int flag[N],n,la[N];
int check(char s1[],int len1,char s2[],int len2){
	for (int i=1;i<=len1&&i<=len2;i++)
		if (s1[i]!=s2[i])return s1[i]>s2[i];
	return len1>=len2;
}
int check2(char s1[],int len1,char s2[],int len2){
	for (int i=1;i<=len1&&i<=len2;i++)
		if (s1[i]!=s2[i])return s1[i]>s2[i];
	return 1;
}
int main(){
	scanf("%d",&n);
	n*=2;
	scanf("%s",s+1);
	int len=0;
	for (int i=1,j=1;i<=n;i=j){
		int cnt=0;
		while (j==i||cnt!=0){
			if (s[j]=='a')cnt++;
			else cnt--;
			j++;
		}
		la[j-1]=i-1;
	}
	for (int i=n,j=n;i;i=j){
		int cnt=0;
		j=la[i];
		int len1=0;
		memset(s1,0,sizeof s1);
		if (s[j+1]=='a'){
			vector<int> p1,p2;
			for (int l=j+1;l<=i;l++)
				if (s[l]=='a')p1.push_back(l);
				else p2.push_back(l);
			int now=0;
			while (now<p1.size()){
				s1[++len1]='a';s1[++len1]='b';
				int k=p2[now];
				while (now<p1.size()&&p1[now]<k)now++;
			}
		}
		else {
			for (int k=1;k<=(i-j)/2;k++){
				memset(flag,0,sizeof flag);
				int cnta=0,cntb=0;
				for (int l=i;l>j;l--)
					if (s[l]=='a'){
						if (cnta<k)flag[l]=1,cnta++;
					}
					else {
						if (cntb<k)flag[l]=1,cntb++;
					}
				int len2=0;
				for (int l=j+1;l<=i;l++)
					if (flag[l])s2[++len2]=s[l];
				if (check(s2,len2,s1,len1)){
					for (int l=1;l<=len2;l++)s1[l]=s2[l];
					len1=len2;
				}
			}
		}
		if (check2(s1,len1,ans,len)){
			for (int l=len;l;l--)ans[l+len1]=ans[l];
			for (int l=1;l<=len1;l++)ans[l]=s1[l];
			len+=len1;
		}
	}
	puts(ans+1);
	return 0;
}
