#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5;
int n, len, a[N], c[N], check[N];
vector<int> tmp;
deque<int> C[N];
string s;
void Solve() {
  for (int i = 0; i <= 2; i++) {
    int c_size = C[i].size();
    if (c_size < len && (check[0] || i == 0)) check[i] = 1, tmp.push_back(i);
  }
  if (tmp.empty()) {
    for (int i = 2; i >= 0; i--) {
      int c_size = C[i].size();
      if (c_size < len) check[i] = 1, tmp.push_back(i);
    }
  }
  for (int i = 0; i < tmp.size(); i++) {
    for (int j = 0; j <= 2; j++) {
      if (check[j] || (!check[j] && C[j].size() <= len)) continue;
      int sz1 = C[tmp[i]].size(), sz2 = C[j].size();
      int it = c[j];
      while (sz1 < len && sz2 > len) {
        if (tmp[i] < j)
          a[C[j].front()] = tmp[i], C[j].pop_front();
        else
          a[C[j].back()] = tmp[i], C[j].pop_back();
        sz2--, sz1++, c[j]++;
      }
    }
  }
  for (int i = 0; i < n; i++) cout << a[i];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  cin >> n >> s;
  len = n / 3;
  for (int i = 0; i < n; i++) {
    if (s[i] == '0') a[i] = 0, C[0].push_back(i);
    if (s[i] == '1') a[i] = 1, C[1].push_back(i);
    if (s[i] == '2') a[i] = 2, C[2].push_back(i);
  }
  Solve();
  return 0;
}
