#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int TESTS = 1;
  while (TESTS--) {
    int n, i;
    string str;
    map<int, int> m;
    cin >> n;
    cin >> str;
    for (i = 0; i < n; i++) {
      m[str[i] - '0']++;
    }
    i = 0;
    while (m[0] < n / 3) {
      if (m[str[i] - '0'] > n / 3) {
        m[0]++;
        m[str[i] - '0']--;
        str[i] = '0';
      }
      i++;
    }
    i = n - 1;
    while (m[2] < n / 3) {
      if (m[str[i] - '0'] > n / 3) {
        m[2]++;
        m[str[i] - '0']--;
        str[i] = '2';
      }
      i--;
    }
    i = 0;
    while (m[1] < n / 3 && i < n) {
      if (str[i] == '2' && m[2] > n / 3) {
        str[i] = '1';
        m[1]++;
        m[2]--;
      }
      i++;
    }
    i = n - 1;
    while (m[1] < n / 3) {
      if (str[i] == '0' && m[0] > n / 3) {
        str[i] = '1';
        m[0]--;
        m[1]++;
      }
      i--;
    }
    cout << str;
  }
  return 0;
}
