#include <bits/stdc++.h>
using namespace std;
const int N = 5e3 + 10;
string s;
int n, avg;
int c[4];
deque<int> g[4];
int main() {
  cin >> n >> s;
  avg = n / 3;
  for (int i = 0; i < n; i++) {
    g[s[i] - '0'].push_back(i);
    c[s[i] - '0']++;
  }
  while (c[0] > avg) {
    if (c[2] < avg) {
      int pos = g[0].back();
      g[0].pop_back();
      s[pos] = '2';
      c[2]++;
    } else if (c[1] < avg) {
      int pos = g[0].back();
      g[0].pop_back();
      s[pos] = '1';
      c[1]++;
    }
    c[0]--;
  }
  while (c[1] > avg) {
    if (c[0] < avg) {
      int pos = g[1].front();
      g[1].pop_front();
      s[pos] = '0';
      c[0]++;
    } else if (c[2] < avg) {
      int pos = g[1].back();
      g[1].pop_back();
      s[pos] = '2';
      c[2]++;
    }
    c[1]--;
  }
  while (c[2] > avg) {
    if (c[0] < avg) {
      int pos = g[2].front();
      g[2].pop_front();
      s[pos] = '0';
      c[0]++;
    } else if (c[1] < avg) {
      int pos = g[2].front();
      g[2].pop_front();
      s[pos] = '1';
      c[1]++;
    }
    c[2]--;
  }
  cout << s << endl;
  return 0;
}
