#include <bits/stdc++.h>
using namespace std;
long long arr[1000100];
long long dp[1000100];
long long n;
bool ok = false;
int mx = 0;
const long long mod = 998244353;
vector<deque<int> > v(3);
int main() {
  cin >> n;
  string s;
  cin >> s;
  for (int i = 0; i < n; i++) {
    int x = s[i] - '0';
    v[x].push_back(i);
  }
  for (int i = 0; i < 3; i++) {
    vector<int> target = {0, 1, 2};
    if (i == 0) {
      target = {2, 1};
    }
    if (v[i].size() > n / 3) {
      for (auto x : target) {
        while (v[x].size() < n / 3 && v[i].size() > n / 3) {
          if (i > x) {
            int t = v[i].front();
            s[t] = '0' + x;
            v[i].pop_front();
            v[x].push_back(t);
          } else {
            int t = v[i].back();
            s[t] = '0' + x;
            v[i].pop_back();
            v[x].push_back(t);
          }
        }
      }
    }
  }
  cout << s << endl;
  return 0;
}
