#include <bits/stdc++.h>
using namespace std;
long long Mod(long long x, long long y, int p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  string str;
  cin >> str;
  map<int, int> m;
  m[0] = 0;
  m[1] = 0;
  m[2] = 0;
  for (int i = 0; i < (int)str.length(); i++) {
    m[str[i] - '0']++;
  }
  for (int i = 0; i < (int)str.length(); i++) {
    if (str[i] != '0' && m[str[i] - '0'] > n / 3 && m[0] < n / 3) {
      m[0]++;
      m[str[i] - '0']--;
      str[i] = '0';
    }
  }
  for (int i = (int)str.length() - 1; i >= 0; i--) {
    if (str[i] != '2' && m[str[i] - '0'] > n / 3 && m[2] < n / 3) {
      m[2]++;
      m[str[i] - '0']--;
      str[i] = '2';
    }
  }
  for (int i = 0; i < (int)str.length(); i++) {
    if (str[i] != '1' && str[i] == '2' && m[2] > n / 3 && m[1] < n / 3) {
      m[1]++;
      m[2]--;
      str[i] = '1';
    }
  }
  for (int i = (int)str.length() - 1; i >= 0; i--) {
    if (str[i] != '1' && str[i] == '0' && m[0] > n / 3 && m[1] < n / 3) {
      m[1]++;
      m[0]--;
      str[i] = '1';
    }
  }
  cout << str << endl;
}
