#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int n;
  string s;
  cin >> n >> s;
  int zero = count(s.begin(), s.end(), '0');
  int one = count(s.begin(), s.end(), '1');
  int two = count(s.begin(), s.end(), '2');
  const int balanced = n / 3;
  for (int i = 0; i < n; ++i) {
    switch (s[i]) {
      case '2':
        if (two > balanced) {
          if (zero < balanced) {
            s[i] = '0';
            --two;
            ++zero;
          } else if (one < balanced) {
            s[i] = '1';
            --two;
            ++one;
          }
        }
        break;
      case '1':
        if (one > balanced) {
          if (zero < balanced) {
            s[i] = '0';
            --one;
            ++zero;
          }
        }
        break;
    }
  }
  for (int i = n - 1; i >= 0; --i) {
    switch (s[i]) {
      case '1':
        if (one > balanced) {
          if (two < balanced) {
            s[i] = '2';
            --one;
            ++two;
          }
        }
        break;
      case '0':
        if (zero > balanced) {
          if (two < balanced) {
            s[i] = '2';
            --zero;
            ++two;
          } else if (one < balanced) {
            s[i] = '1';
            --zero;
            ++one;
          }
        }
        break;
    }
  }
  cout << s << '\n';
  return 0;
}
