#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int n0, n2, n1;
  int p0 = 0, p1 = 0, p2 = 0;
  n0 = n2 = n1 = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '0')
      n0++;
    else if (s[i] == '1')
      n1++;
    else if (s[i] == '2')
      n2++;
  }
  p0 = n0 - n / 3;
  p1 = n1 - n / 3;
  p2 = n2 - n / 3;
  if (p0 < 0) {
    for (int i = 0; i < s.size(); i++) {
      if (p0 == 0) break;
      if (s[i] == '1' && p1 > 0) {
        s[i] = '0';
        p0++;
        p1--;
      } else if (s[i] == '2' && p2 > 0) {
        s[i] = '0';
        p0++;
        p2--;
      }
    }
  }
  if (p2 < 0) {
    for (int i = s.size() - 1; i >= 0; i--) {
      if (p2 == 0) break;
      if (s[i] == '1' && p1 > 0) {
        s[i] = '2';
        p2++;
        p1--;
      } else if (s[i] == '0' && p0 > 0) {
        s[i] = '2';
        p0--;
        p2++;
      }
    }
  }
  if (p1 < 0) {
    for (int i = 0; i < s.size(); i++) {
      if (p1 == 0) break;
      if (s[i] == '2' && p2 > 0) {
        s[i] = '1';
        p2--;
        p1++;
      }
    }
    for (int i = s.size() - 1; i >= 0; i--) {
      if (p1 == 0) break;
      if (s[i] == '0' && p0 > 0) {
        s[i] = '1';
        p0--;
        p1++;
      }
    }
  }
  cout << s;
  return 0;
}
