#include <bits/stdc++.h>
using namespace std;
long long int c = 0, d = 0, e = 0, f, g, h, i, j, k, l, m, n, o, p, q, t, x, y,
              z;
long long int mn = 8675435789, mx = -8675868757, PI = 3.14159265359,
              md = 1000000007, aa = 0, bb = 0, cc = 0;
string r, s, u, v, w;
long long int a[250002], b[250002];
map<long long int, long long int> mp, mq;
queue<long long int> qu, qe;
pair<long long int, long long int> pp[30030];
set<string> se, sa;
int main() {
  {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
  }
  cin >> n >> s;
  for (i = 0; i < n; i++) {
    if (s[i] == '0') aa++;
    if (s[i] == '1') bb++;
    if (s[i] == '2') cc++;
  }
  p = n / 3;
  for (i = 0; i < n; i++) {
    if (s[i] == '0') {
      c++;
      if (c <= p)
        cout << s[i];
      else {
        if (bb < p) {
          cout << "1";
          bb++;
        } else {
          cout << "2";
          cc++;
        }
        aa--;
      }
    }
    if (s[i] == '1') {
      e++;
      if (bb <= p)
        cout << s[i];
      else {
        if (e <= p && aa >= p)
          cout << s[i];
        else if (aa < p) {
          cout << "0";
          aa++;
          c++;
          bb--;
          e--;
        } else {
          cout << "2";
          cc++;
          bb--;
          e--;
        }
      }
    }
    if (s[i] == '2') {
      if (cc <= p)
        cout << s[i];
      else {
        if (aa < p) {
          cout << "0";
          aa++;
          c++;
        } else {
          cout << "1";
          bb++;
          e++;
        }
        cc--;
      }
    }
  }
}
