#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool inrange(T a, T l, T r) {
  if (l > r) swap(l, r);
  return (a >= l and a <= r);
}
template <typename T, typename U>
inline bool exist(T val, U &any) {
  return (any.find(val) != any.end());
}
template <typename T>
inline void inp(T &any) {
  cin >> any;
}
template <typename T, typename... U>
inline void inp(T &a, U &...b) {
  cin >> a;
  inp(b...);
}
template <typename T>
inline istream &operator>>(istream &in, vector<T> &a) {
  for (auto &x : a) in >> x;
  return in;
}
template <typename T, typename U>
inline istream &operator>>(istream &in, pair<T, U> &a) {
  in >> a.first >> a.second;
  return in;
}
void solve() {
  long long int n;
  std::cin >> n;
  string s;
  std::cin >> s;
  long long int x = n / 3;
  vector<long long int> b(3);
  for (long long int i = (0); i < (n); i++) b[s[i] - '0']++;
  if (b[0] < x) {
    for (long long int i = (0); i < (n); i++) {
      if (b[0] == x) break;
      if (b[s[i] - '0'] > x) {
        b[s[i] - '0']--;
        s[i] = '0';
        b[0]++;
      }
    }
  }
  if (b[2] < x) {
    for (long long int i = (n - 1); i >= (0); i--) {
      if (b[2] == x) break;
      if (b[s[i] - '0'] > x) {
        b[s[i] - '0']--;
        s[i] = '2';
        b[2]++;
      }
    }
  }
  b[0] = 0;
  if (b[1] < x) {
    for (long long int i = (0); i < (n); i++) {
      if (b[1] == x) break;
      if (s[i] == '0') {
        b[0]++;
        if (b[0] > x) {
          s[i] = '1';
          b[1]++;
        }
      } else if (s[i] == '2') {
        b[2]--;
        if (b[2] >= x) {
          s[i] = '1';
          b[1]++;
        }
      }
    }
  }
  std::cout << s << '\n';
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int t = 1;
  for (long long int i = (1); i < (t + 1); i++) {
    cerr << "Case #" << i << "\n";
    solve();
  }
  return 0;
}
