#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  string s;
  cin >> n >> s;
  int cnt[3] = {0};
  for (auto c : s) cnt[c - '0']++;
  int req = n / 3;
  if (cnt[0] < req) {
    if (cnt[2] > req) {
      for (int i = 0; i < s.length() && cnt[2] > req && cnt[0] < req; i++)
        if (s[i] == '2') s[i] = '0', cnt[0]++, cnt[2]--;
    }
    if (cnt[1] > req) {
      for (int i = 0; i < s.length() && cnt[1] > req && cnt[0] < req; i++)
        if (s[i] == '1') s[i] = '0', cnt[0]++, cnt[1]--;
    }
  }
  if (cnt[2] < req) {
    if (cnt[1] > req) {
      for (int i = s.length() - 1; i >= 0 && cnt[1] > req && cnt[2] < req; i--)
        if (s[i] == '1') s[i] = '2', cnt[2]++, cnt[1]--;
    }
    if (cnt[0] > req) {
      for (int i = s.length() - 1; i >= 0 && cnt[0] > req && cnt[2] < req; i--)
        if (s[i] == '0') s[i] = '2', cnt[0]--, cnt[2]++;
    }
  }
  if (cnt[1] < req) {
    if (cnt[2] > req) {
      for (int i = 0; i < s.length() && cnt[2] > req && cnt[1] < req; i++)
        if (s[i] == '2') s[i] = '1', cnt[1]++, cnt[2]--;
    }
    if (cnt[0] > req) {
      for (int i = s.length() - 1; i >= 0 && cnt[1] < req && cnt[0] > req; i--)
        if (s[i] == '0') s[i] = '1', cnt[0]--, cnt[1]++;
    }
  }
  cout << s << '\n';
  return 0;
}
