#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int len;
  string str;
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> len >> str;
  int count0 = 0, count1 = 0, count2 = 0;
  for (int i = 0; i < len; i++) {
    if (str[i] == '0')
      count0++;
    else if (str[i] == '1')
      count1++;
    else
      count2++;
  }
  int val = len / 3;
  if (count2 < val) {
    int i = len - 1;
    while (i >= 0 && count2 < val) {
      if (str[i] == '0' && count0 > val) {
        str[i] = '2';
        count0--;
        count2++;
      } else if (str[i] == '1' && count1 > val) {
        str[i] = '2';
        count1--;
        count2++;
      }
      i--;
    }
  }
  if (count0 < val) {
    int i = 0;
    while (i < len && count0 < val) {
      if (str[i] == '1' && count1 > val) {
        str[i] = '0';
        count0++;
        count1--;
      } else if (str[i] == '2' && count2 > val) {
        str[i] = '0';
        count0++;
        count2--;
      }
      i++;
    }
  }
  if (count1 < val) {
    int i = 0;
    while (i < len && count1 < val) {
      if (str[i] == '2' && count2 > val) {
        str[i] = '1';
        count1++;
        count2--;
      }
      i++;
    }
    i = len - 1;
    while (i >= 0 && count1 < val) {
      if (str[i] == '0' && count0 > val) {
        str[i] = '1';
        count1++;
        count0--;
      }
      i--;
    }
  }
  cout << str;
  return 0;
}
