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;

#ifdef WIN32
	#define I64 "%I64d"
#else
	#define I64 "%lld"
#endif

typedef long long ll;

#define f first
#define s second
#define mp make_pair
#define pb push_back
#define all(s) s.begin(), s.end()
#define sz(s) (int(s.size()))
#define fname "a"
#define MAXN 7777

int n, k;
char s[MAXN];
int pos[MAXN];
vector <int> g[2];
string d[MAXN], t;
int dp[MAXN];

int main()
{
	#ifdef LOCAL
	freopen(fname".in", "r", stdin);
	freopen(fname".out", "w", stdout);
	#endif

	scanf("%d", &n);
	scanf("%s", s);
	for (int i = 0; i < n + n; ++i) {
		pos[i] = sz(g[s[i] - 'a']);
		g[s[i] - 'a'].pb(i);
	}

	for (int i = 0, j; i < n + n; i = j, ++k) {
		int ka = 0, kb = 0;
		s[i] == 'a' ? ++ka : ++kb;
		j = i + 1;
		while(j < n + n && ka != kb) {
			s[j] == 'a' ? ++ka : ++kb;
			++j;
		}

		int first = pos[i], last = pos[j - 1];
		int hasba = 0;
		for (int z = first; z <= last; ++z) {
			if (g[0][z] > g[1][z])
				hasba = 1;
		}

		if (!hasba) {
			d[k] = "";
			int ri = -1;
			for (int z = first; z <= last; ++z) {
				if (g[0][z] <= ri) continue;
				ri = g[1][z];
				d[k] += "ab";
			}
		} else {
			d[k] = "";
			for (int z = first; z <= last; ++z) {
				t = "";
				for (int y = i; y < j; ++y) {
					if (pos[y] < z) continue;
					t += s[y];
				}
				if (lexicographical_compare(all(d[k]), all(t))) {
					d[k] = t;
				}
			}			
		}
	}

	string ans = "";
	for (int i = k - 1; i >= 0; --i) {
		t = d[i] + ans;
		if (lexicographical_compare(all(ans), all(t))) {
			ans = t;
		}
		t = d[i];
		if (lexicographical_compare(all(ans), all(t))) {
			ans = t;
		}
	}

	puts(ans.c_str());

	return 0;
}
