#include <bits/stdc++.h>
using namespace std;
using namespace std;
int n;
string s;
int main() {
  while (cin >> n) {
    cin >> s;
    int x = n / 3;
    int zero = 0, one = 0, two = 0;
    for (int i = 0; i < n; i++) {
      if (s[i] == '0')
        zero++;
      else if (s[i] == '1')
        one++;
      else
        two++;
    }
    zero -= x;
    one -= x;
    two -= x;
    if (zero < 0 && one >= 0 && two >= 0) {
      for (int i = 0; i < n; i++) {
        if (s[i] == '2' && zero < 0 && two > 0)
          s[i] = '0', zero++, two--;
        else if (s[i] == '1' && zero < 0 && one > 0)
          s[i] = '0', zero++, one--;
      }
    } else if (one < 0 && zero >= 0 && two >= 0) {
      int now0 = 0;
      for (int i = 0; i < n; i++) {
        if (s[i] == '0' && now0 < x)
          now0++;
        else if (s[i] == '2' && one < 0 && two > 0)
          s[i] = '1', one++, two--;
        else if (s[i] == '0' && one < 0 && zero > 0 && now0 == x)
          s[i] = '1', one++, zero--;
      }
    } else if (two < 0 && zero >= 0 && one >= 0) {
      int now0 = 0, now1 = 0;
      for (int i = 0; i < n; i++) {
        if (s[i] == '0' && now0 < x)
          now0++;
        else if (s[i] == '1' && now1 < x)
          now1++;
        else if (s[i] == '1' && one > 0 && now1 == x && two < 0)
          s[i] = '2', one--, two++;
        else if (s[i] == '0' && zero > 0 && now0 == x && two < 0)
          s[i] = '2', zero--, two++;
      }
    } else if (zero < 0 && one < 0 && two > 0) {
      for (int i = 0; i < n; i++)
        if (s[i] == '2' && two > 0 && zero < 0)
          s[i] = '0', two--, zero++;
        else if (s[i] == '2' && two > 0 && one < 0)
          s[i] = '1', two--, one++;
    } else if (zero < 0 && two < 0 && one > 0) {
      int now1 = 0;
      for (int i = 0; i < n; i++) {
        if (s[i] == '1' && zero == 0 && now1 < x)
          now1++;
        else if (s[i] == '1' && zero < 0 && one > 0)
          s[i] = '0', zero++, one--;
        else if (s[i] == '1' && now1 == x && two < 0 && one > 0)
          s[i] = '2', two++, one--;
      }
    } else if (one < 0 && two < 0 && zero > 0) {
      int now0 = 0;
      for (int i = 0; i < n; i++) {
        if (s[i] == '0' && now0 < x)
          now0++;
        else if (s[i] == '0' && one < 0 && now0 == x && zero > 0)
          s[i] = '1', one++, zero--;
        else if (s[i] == '0' && two < 0 && now0 == x && zero > 0)
          s[i] = '2', two++, zero--;
      }
    }
    cout << s << endl;
  }
  return 0;
}
