#include <bits/stdc++.h>
using namespace std;
long long n, m, q, k;
string s;
int MOD = 1e9 + 7;
const int INF = 1e9;
const long long INF64 = 2e18;
const double PI = 3.141592653589793238463;
long long ar[500004], ar1[500004], ar2[500004], vis[500004];
map<int, int> cmap[5004];
vector<long long> gr[500004], path;
set<long long> myset;
pair<long long, long long> seg[500004], tree[4 * 500004];
map<string, long long> mymap;
string st1[500004], st2[500004];
vector<long long> arr[500004];
int comp(pair<long long, long long> a, pair<long long, long long> b) {
  return a.second < b.second;
}
struct {
  int op, ind, x;
} ops[500004];
bool check(string s, long long sz) {
  stack<char> st;
  for (int i = 0; i < int(s.size()); i++) {
    if (s[i] == '(')
      st.push('(');
    else {
      if (!st.empty() && st.top() == '(')
        st.pop();
      else
        st.push(')');
    }
  }
  return st.size() == abs(sz);
}
long long c[3];
int main() {
  std::ios_base::sync_with_stdio(false);
  cin >> n;
  cin >> s;
  for (int i = 0; i < int(n); i++) c[s[i] - '0']++;
  if (c[0] < n / 3 && c[1] >= n / 3 && c[2] >= n / 3) {
    int i = 0;
    while (c[1] > n / 3) {
      while (s[i] != '1') i++;
      s[i] = '0';
      c[0]++;
      c[1]--;
      if (c[0] == n / 3) break;
    }
    i = 0;
    while (c[2] > n / 3) {
      while (s[i] != '2') i++;
      s[i] = '0';
      c[0]++;
      c[2]--;
      if (c[0] == n / 3) break;
    }
  }
  if (c[1] < n / 3 && c[0] >= n / 3 && c[2] >= n / 3) {
    int i = n - 1;
    while (c[0] > n / 3) {
      while (s[i] != '0') i--;
      s[i] = '1';
      c[1]++;
      c[0]--;
      if (c[1] == n / 3) break;
    }
    i = 0;
    while (c[2] > n / 3) {
      while (s[i] != '2') i++;
      s[i] = '1';
      c[1]++;
      c[2]--;
      if (c[1] == n / 3) break;
    }
  }
  if (c[2] < n / 3 && c[0] >= n / 3 && c[1] >= n / 3) {
    int i = n - 1;
    while (c[0] > n / 3) {
      while (s[i] != '0') i--;
      s[i] = '2';
      c[2]++;
      c[0]--;
      if (c[2] == n / 3) break;
    }
    i = n - 1;
    while (c[1] > n / 3) {
      while (s[i] != '1') i--;
      s[i] = '2';
      c[2]++;
      c[1]--;
      if (c[2] == n / 3) break;
    }
  }
  if (c[0] > n / 3 && c[1] <= n / 3 && c[2] <= n / 3) {
    int i = n - 1;
    while (c[2] < n / 3) {
      while (s[i] != '0') i--;
      s[i] = '2';
      c[2]++;
      c[0]--;
    }
    i = n - 1;
    while (c[1] < n / 3) {
      while (s[i] != '0') i--;
      s[i] = '1';
      c[1]++;
      c[0]--;
    }
  }
  if (c[0] <= n / 3 && c[1] > n / 3 && c[2] <= n / 3) {
    int i = 0;
    while (c[0] < n / 3) {
      while (s[i] != '1') i++;
      s[i] = '0';
      c[0]++;
      c[1]--;
    }
    i = n - 1;
    while (c[2] < n / 3) {
      while (s[i] != '1') i--;
      s[i] = '2';
      c[2]++;
      c[1]--;
    }
  }
  if (c[0] <= n / 3 && c[1] <= n / 3 && c[2] > n / 3) {
    int i = 0;
    while (c[0] < n / 3) {
      while (s[i] != '2') i++;
      s[i] = '0';
      c[0]++;
      c[2]--;
    }
    i = 0;
    while (c[1] < n / 3) {
      while (s[i] != '2') i++;
      s[i] = '1';
      c[1]++;
      c[2]--;
    }
  }
  return cout << s, 0;
}
