#include <bits/stdc++.h>
using namespace std;
clock_t clock_start = clock();
double getCurTime() { return (clock() - clock_start) * 1.0 / CLOCKS_PER_SEC; }
template <typename T>
ostream &operator<<(ostream &out, const vector<T> &vec) {
  const int n = vec.size();
  out << '[';
  for (int i = 0; i < n; i++) {
    out << vec[i] << (i == n - 1 ? "]" : ", ");
  }
  return out;
}
pair<long long, long long> exgcd(const long long x, const long long y) {
  if (!y) {
    return make_pair(1, 0);
  }
  pair<long long, long long> cur = exgcd(y, x % y);
  return make_pair(cur.second, cur.first - (x / y) * cur.second);
}
const long long __mod__ = 998244353ll;
long long mod(long long x, long long p = __mod__) { return ((x % p) + p) % p; }
long long mmod() { return 1ll; }
template <typename T, typename... U>
long long mmod(const T &head, const U &...tail) {
  return mod(head * mmod(tail...), __mod__);
}
void print() {}
template <typename T, typename... U>
void print(const T &head, const U &...tail) {
  cout << head << (sizeof...(tail) ? ' ' : '\n');
  print(tail...);
}
inline long long fmul(long long a, long long c,
                      const long long &Mod = __mod__) {
  a %= Mod, c %= Mod;
  return (a * c - (long long)(((long double)a * c + 0.5) / Mod) * Mod) % Mod;
}
long long _gcd(const long long x, const long long y) {
  return y == 0 ? x : _gcd(y, x % y);
}
long long gcd() { return 0ll; }
template <typename T, typename... U>
long long gcd(const T &head, const U &...tail) {
  return _gcd(head, gcd(tail...));
}
long long fpow(long long a, long long b, const long long &p = __mod__) {
  long long ans = 1ll;
  for (a %= p; b; a = a * a % p, b >>= 1) {
    if (b & 1) {
      ans = ans * a % p;
    }
  }
  return ans;
}
void solve();
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
void solve() {
  int n;
  cin >> n;
  const int aim = n / 3;
  string s;
  cin >> s;
  int cur[3] = {0};
  for (auto &i : s) {
    cur[i - '0']++;
  }
  for (auto &i : s) {
    if (cur[i - '0'] > aim) {
      for (char j = '0'; j < i; j++) {
        if (cur[j - '0'] < aim) {
          cur[i - '0']--;
          cur[j - '0']++;
          i = j;
          break;
        }
      }
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    if (cur[s[i] - '0'] > aim) {
      for (char j = '2'; j >= '0'; j--) {
        if (cur[j - '0'] < aim) {
          cur[s[i] - '0']--;
          cur[j - '0']++;
          s[i] = j;
          break;
        }
      }
    }
  }
  print(s);
}
