#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  return (b == 0 ? a : gcd(b, a % b));
}
long long int lcm(long long int a, long long int b) {
  return a * b / gcd(a, b);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n;
  cin >> n;
  string s;
  cin >> s;
  pair<int, int> mi[3];
  for (int i = 0; i < 3; ++i) {
    mi[i].second = i;
    mi[i].first = 0;
  }
  for (int i = 0; i < n; ++i) {
    mi[s[i] - '0'].first++;
  }
  if (mi[0].first == mi[1].first && mi[1].first == mi[2].first) {
    cout << s << "\n";
  } else {
    int k = n / 3;
    if (mi[0].first < k) {
      for (int i = 0; i < n; ++i) {
        if (s[i] != '0') {
          if (mi[s[i] - '0'].first > k) {
            mi[s[i] - '0'].first--;
            s[i] = '0';
            mi[0].first++;
          }
        }
        if (mi[0].first == k) break;
      }
    }
    if (mi[2].first < k) {
      for (int i = n - 1; i >= 0; --i) {
        if (s[i] != '2') {
          if (mi[s[i] - '0'].first > k) {
            mi[s[i] - '0'].first--;
            s[i] = '2';
            mi[2].first++;
          }
        }
        if (mi[2].first == k) break;
      }
    }
    if (mi[1].first < k) {
      if (mi[0].first > k) {
        for (int i = n - 1; i >= 0 && mi[0].first > k; --i) {
          if (s[i] == '0') {
            mi[0].first--;
            s[i] = '1';
            mi[1].first++;
          }
        }
      }
      if (mi[2].first > k) {
        for (int i = 0; i < n && mi[2].first > k; ++i) {
          if (s[i] == '2') {
            s[i] = '1';
            mi[2].first--;
            mi[1].first++;
          }
        }
      }
    }
    cout << s;
  }
  return 0;
}
