#include <bits/stdc++.h>
using namespace std;
int n, t, h[300001] = {},
          p[6][2] = {{2, 0}, {2, 1}, {1, 0}, {0, 2}, {0, 1}, {1, 2}};
string s;
void sw(int a, int b) {
  int i = a > b ? 0 : n - 1;
  while (h[a] > t && h[b] < t) {
    if (s[i] - '0' == a) {
      s[i] = b + '0';
      h[a]--;
      h[b]++;
    }
    if (a > b)
      ++i;
    else
      --i;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  t = n / 3;
  cin >> s;
  for (auto &c : s) {
    h[c - '0']++;
  }
  for (int i = 0; i < 6; ++i) {
    sw(p[i][0], p[i][1]);
  }
  cout << s << endl;
  return 0;
}
