#include <bits/stdc++.h>
using namespace std;
const int N = 2e5;
int n;
string s;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout << fixed;
  cout.precision(10);
  ;
  cin >> n >> s;
  int zero = 0, one = 0, two = 0;
  for (long long i = 0; i < n; i++) {
    zero += (s[i] == '0');
    one += (s[i] == '1');
    two += (s[i] == '2');
  }
  zero = (n / 3) - zero;
  one = n / 3 - one;
  two = n / 3 - two;
  for (int i = 0; i < n and zero > 0; i++) {
    if (s[i] == '1' and one < 0) {
      s[i] = '0', zero--;
      one++;
    } else if (s[i] == '2' and two < 0) {
      s[i] = '0', zero--;
      two++;
    }
  }
  int c0 = 0;
  for (int i = 0; i < n and one > 0; i++) {
    if (s[i] == '0' and zero < 0 and c0 >= n / 3) {
      s[i] = '1', one--;
      zero++;
    } else if (s[i] == '2' and two < 0) {
      s[i] = '1', one--;
      two++;
    }
    c0 += (s[i] == '0');
  }
  int c1;
  c0 = c1 = 0;
  for (int i = 0; i < n and two > 0; i++) {
    if (s[i] == '0' and zero < 0 and c0 >= n / 3) {
      s[i] = '2', two--;
      zero++;
    } else if (s[i] == '1' and one < 0 and c1 >= n / 3) {
      s[i] = '2', two--;
      one++;
    }
    c0 += (s[i] == '0');
    c1 += (s[i] == '1');
  }
  cout << s;
  return 0;
}
