#include <bits/stdc++.h>
using namespace std;
void start() {}
void sober() {
  long long int n, x = 0, a = 0, b = 0, y = 0, sum = 0, k = 0, m = 0;
  string s;
  cin >> n >> s;
  vector<long long int> v(n, 0);
  map<char, long long int> mp;
  for (long long int i = 0; i < n; i++) {
    mp[s[i]] += 1;
    v[i] = s[i] - '0';
  }
  if (mp['0'] == mp['1'] and mp['1'] == mp['2']) {
    cout << s << "\n";
    return;
  }
  long long int z = 0;
  x = mp['0'], y = mp['1'], z = mp['2'];
  long long int res = n / 3;
  vector<long long int> fre(3, 0);
  for (long long int i = 0; i < n; i++) {
    long long int cur = s[i] - '0';
    if (s[i] == '0' and mp[s[i]] > n / 3) {
      if (fre[cur] < n / 3) {
        fre[cur]++;
      } else {
        if (mp['1'] < n / 3) {
          s[i] = '1';
          mp['1']++;
          mp['0']--;
        } else if (mp['2'] < n / 3) {
          mp['2']++;
          s[i] = '2';
          mp['0']--;
        }
      }
    } else if (s[i] == '1' and mp[s[i]] > n / 3) {
      if (mp['0'] < n / 3) {
        s[i] = '0';
        mp['0']++;
        mp['1']--;
      } else if (fre[cur] < n / 3) {
        fre[cur]++;
      } else if (mp['2'] < n / 3) {
        mp['2']++;
        s[i] = '2';
        mp['1']--;
      }
    } else if (s[i] == '2' and mp[s[i]] > n / 3) {
      if (mp['0'] < n / 3) {
        s[i] = '0';
        mp['0']++;
        mp['2']--;
      } else if (mp['1'] < n / 3) {
        mp['1']++;
        s[i] = '1';
        mp['2']--;
      }
    }
  }
  cout << s << "\n";
}
signed main() {
  start();
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int t = 1;
  while (t--) {
    sober();
  }
}
