#include <bits/stdc++.h>
using namespace std;
bool pusu(pair<long long int, long long int> a,
          pair<long long int, long long int> b) {
  return b.second > a.second;
}
string ntos(long long int n) {
  ostringstream str1;
  str1 << n;
  return str1.str();
}
long long int ston(string s) {
  long long int x;
  stringstream str1(s);
  str1 >> x;
  return x;
}
string t = "012";
void kor(int n) {
  string s;
  cin >> s;
  int m = n / 3;
  int a[3] = {0};
  for (int i = 0; i < n; i++) {
    if (s[i] == '1')
      a[1]++;
    else if (s[i] == '2')
      a[2]++;
    else
      a[0]++;
  }
  if (a[0] == a[1] && a[1] == a[2]) {
    cout << s;
    return;
  }
  for (int i = 0; i < n; i++) {
    if (s[i] != '0') {
      if (a[0] >= m) {
        break;
      }
      if (s[i] == '1' && a[1] > m) {
        s[i] = '0';
        a[0]++;
        a[1]--;
      } else if (s[i] == '2' && a[2] > m) {
        s[i] = '0';
        a[0]++;
        a[2]--;
      }
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] != 2) {
      if (a[2] >= m) break;
      if (s[i] == '0' && a[0] > m) {
        s[i] = '2';
        a[0]--;
        a[2]++;
      } else if (s[i] == '1' && a[1] > m) {
        s[i] = '2';
        a[2]++;
        a[1]--;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (s[i] != '1') {
      if (a[1] >= m) {
        break;
      }
      if (s[i] == '2' && a[2] > m) {
        s[i] = '1';
        a[1]++;
        a[2]--;
      }
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] != '1') {
      if (a[1] >= m) break;
      if (s[i] == '0' && a[0] > m) {
        s[i] = '1';
        a[1]++;
        a[0]--;
      }
    }
  }
  cout << s;
}
int main() {
  int n;
  cin >> n;
  kor(n);
}
