#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int n, c0 = 0, c2 = 0, c1 = 0;
  cin >> n >> s;
  for (auto c : s) {
    if (c == '0') c0++;
    if (c == '1') c1++;
    if (c == '2') c2++;
  }
  int m = s.size() / 3;
  if (c0 == c1 && c1 == 2 && c2 == m) return cout << s, 0;
  if (c0 < m) {
    for (int i = 0; i < n; i++) {
      if (c0 == m) break;
      if (s[i] != '0') {
        if (c1 - 1 >= m && s[i] == '1') {
          s[i] = '0';
          c1--;
          c0++;
        }
        if (c2 - 1 >= m && s[i] == '2') {
          s[i] = '0';
          c2--;
          c0++;
        }
      }
    }
  }
  if (c2 < m) {
    for (int i = n - 1; i > -1; i--) {
      if (c2 == m) break;
      if (s[i] != '2') {
        if (c1 - 1 >= m && s[i] == '1') {
          s[i] = '2';
          c1--;
          c2++;
        }
        if (c0 - 1 >= m && s[i] == '0') {
          s[i] = '2';
          c0--;
          c2++;
        }
      }
    }
  }
  if (c1 < m) {
    if (c2 > m) {
      for (int i = 0; i < n; i++) {
        if (c2 == m) break;
        if (s[i] == '2' && c2 - 1 >= m) {
          s[i] = '1';
          c2--;
          c1++;
        }
      }
    }
    if (c0 > m) {
      for (int i = n - 1; i > -1; i--) {
        if (c0 == m) break;
        if (s[i] == '0' && c0 - 1 >= m) {
          s[i] = '1';
          c0--;
          c1++;
        }
      }
    }
  }
  cout << s;
  return 0;
}
