#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000000 + 7;
long long power(long long x, long long y) {
  long long res = 1;
  x = x;
  while (y > 0) {
    if (y & 1) res = (res * x);
    y = y >> 1;
    x = (x * x);
  }
  return res;
}
long long powe(long long x, long long y) {
  x = x % mod, y = y % (mod - 1);
  long long ans = 1;
  while (y > 0) {
    if (y & 1) {
      ans = (1ll * x * ans) % mod;
    }
    y >>= 1;
    x = (1ll * x * x) % mod;
  }
  return ans;
}
void fun() {}
bool isPrime(long long n) {
  for (long long i = 2; i * i <= n; i++)
    if (n % i == 0) return false;
  return true;
}
long long ncr(long long n, long long r) {
  long long res = 1;
  if (r > n) return 0;
  if (r > n - r) r = n - r;
  for (long long i = 0; i < r; i++) {
    res *= (n - i);
    res /= (i + 1);
  }
  return res;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  fun();
  long long ttt = 1;
  while (ttt--) {
    long long n;
    cin >> n;
    string s;
    cin >> s;
    long long zero = 0, one = 0, two = 0;
    for (long long i = 0; i < n; i++) {
      if (s[i] == '0')
        zero++;
      else if (s[i] == '1')
        one++;
      else
        two++;
    }
    long long each = n / 3;
    if (one == each and two == each and zero == each) return cout << s, 0;
    long long i = 0;
    while (zero < each and i < n) {
      if (one > each and s[i] == '1') {
        s[i] = '0', zero++, one--;
      } else if (s[i] == '2' and two > each)
        s[i] = '0', zero++, two--;
      i++;
    }
    i = 0;
    while (one < each and i < n) {
      if (two > each and s[i] == '2') {
        s[i] = '1', one++, two--;
      }
      i++;
    }
    i = n - 1;
    while (two < each and i >= 0) {
      if (one > each and s[i] == '1') {
        s[i] = '2', one--, two++;
      } else if (zero > each and s[i] == '0') {
        s[i] = '2', zero--, two++;
      }
      i--;
    }
    while (one < each and i >= 0) {
      if (zero > each and s[i] == '0') {
        s[i] = '1', zero--, one++;
      }
      i--;
    }
    cout << s << "\n";
  }
  return 0;
}
