#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
void amin(T& a, U b) {
  if (a > b) a = b;
}
template <typename T, typename U>
void amax(T& a, U b) {
  if (a < b) a = b;
}
const long long INF = 1e18;
const int32_t M = 1e9 + 7;
void solve() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long o = 0, z = 0, t = 0;
  for (long long i = 0; i < n; i++) {
    if (s[i] == '0')
      z++;
    else if (s[i] == '1')
      o++;
    else
      t++;
  }
  long long zero = 0, one = 0, two = 0;
  long long req = n / 3;
  for (long long i = 0; i < n; i++) {
    if (s[i] == '0') {
      if (zero < req) {
        zero++;
        continue;
      }
      if (o < req && one < req) {
        z -= 1;
        o += 1;
        one++;
        s[i] = '1';
      } else if (t < req && two < req) {
        t += 1;
        two++;
        z -= 1;
        s[i] = '2';
      }
    } else if (s[i] == '1') {
      if (o > req && z < req && zero < req) {
        z += 1;
        o -= 1;
        zero++;
        s[i] = '0';
      } else if (one >= req && t < req && two < req) {
        t += 1;
        two++;
        o -= 1;
        s[i] = '2';
      } else
        one++;
    } else {
      if (t > req && z < req && zero < req) {
        t -= 1;
        zero++;
        z += 1;
        s[i] = '0';
      } else if (t > req && o < req && one < req) {
        o += 1;
        one++;
        t -= 1;
        s[i] = '1';
      } else
        two++;
    }
  }
  cout << s << "\n";
}
void input() {}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  input();
  int i = 1;
  { solve(); }
}
