#include <bits/stdc++.h>
using namespace std;
string s;
int N;
int zero, one, two, mid;
bool i_zero, i_one, i_two;
int l_zero, l_one, l_two;
int main() {
  while (cin >> N >> s) {
    l_zero = l_one = l_two = 0;
    zero = one = two = 0;
    for (int i = 0; i < s.size(); i++) {
      if (s[i] == '0') zero++;
      if (s[i] == '1') one++;
      if (s[i] == '2') two++;
    }
    mid = N / 3;
    i_zero = i_one = i_two = false;
    int c_zero = zero - mid;
    if (c_zero > 0) {
      i_zero = true;
      l_zero = zero - mid;
    }
    int c_one = one - mid;
    if (c_one > 0) {
      i_one = true;
      l_one = one - mid;
    }
    int c_two = two - mid;
    if (c_two > 0) {
      i_two = true;
      l_two = two - mid;
    }
    int pay = 0, ct;
    if ((i_zero && i_one) || (i_zero && i_two) || (i_one && i_two)) {
      pay = (l_zero + l_one + l_two) / 2;
    }
    int Two = two, One = one, Zero = zero;
    ct = 0;
    if (i_two) {
      for (int i = 0; i < s.size(); ++i) {
        if (ct <= Two - mid && zero < mid && two > mid) {
          if (s[i] == '2') {
            s[i] = '0';
            ct++;
            zero++;
            two--;
            if (zero == mid) ct = 0;
          }
        } else if (ct <= Two - mid && one < mid && two > mid) {
          if (s[i] == '2') {
            s[i] = '1';
            ct++;
            one++;
            two--;
            if (one == mid) ct = 0;
          }
        } else
          break;
      }
    }
    ct = 0;
    if (i_one) {
      for (int i = 0; i < s.size(); ++i) {
        if (ct <= One - mid && zero < mid && one > mid) {
          if (s[i] == '1') {
            s[i] = '0';
            ct++;
            zero++;
            one--;
            if (zero == mid) ct = 0;
          }
        } else
          break;
      }
      ct = 0;
      for (int i = s.size() - 1; i >= 0; --i) {
        if (ct <= One - mid && two < mid && one > mid) {
          if (s[i] == '1') {
            s[i] = '2';
            ct++;
            two++;
            one--;
            if (two == mid) ct = 0;
          }
        } else
          break;
      }
    }
    ct = 0;
    if (i_zero) {
      for (int i = s.size() - 1; i >= 0; --i) {
        if (ct <= Zero - mid && two < mid && zero > mid) {
          if (s[i] == '0') {
            s[i] = '2';
            ct++;
            two++;
            zero--;
            if (two == mid) ct = 0;
          }
        } else if (ct <= Zero - mid && one < mid && zero > mid) {
          if (s[i] == '0') {
            s[i] = '1';
            ct++;
            one++;
            zero--;
            if (one == mid) ct = 0;
          }
        } else
          break;
      }
    }
    cout << s << endl;
  }
  return 0;
}
