#include <bits/stdc++.h>
using namespace std;
const long long int N = 1000000000;
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  string s;
  cin >> s;
  int rep = (n / 3);
  int c[3];
  c[0] = count(s.begin(), s.end(), '0');
  c[1] = count(s.begin(), s.end(), '1');
  c[2] = count(s.begin(), s.end(), '2');
  if (c[0] < rep) {
    for (int i = 0; i < n && c[0] < rep; i++) {
      if (c[s[i] - '0'] > rep) {
        c[s[i] - '0']--;
        c[0]++;
        s[i] = '0';
      }
    }
  }
  for (int i = n - 1; i >= 0 && c[2] < rep; i--) {
    if (c[s[i] - '0'] > rep) {
      c[s[i] - '0']--;
      c[2]++;
      s[i] = '2';
    }
  }
  for (int i = 0; i < n && c[1] < rep; i++) {
    if (s[i] == '2' && c[2] > rep) {
      c[s[i] - '0']--;
      s[i] = '1';
      c[1]++;
    }
  }
  for (int i = n - 1; i >= 0 && c[1] < rep; i--) {
    if (c[s[i] - '0'] > rep) {
      c[s[i] - '0']--;
      s[i] = '1';
      c[1]++;
    }
  }
  cout << s << endl;
}
