#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j;
  cin >> n;
  string s;
  cin >> s;
  int x = 0, y = 0, z = 0;
  for (i = 0; s[i] != '\0'; i++) {
    if (s[i] == '0')
      x++;
    else if (s[i] == '1')
      y++;
    else
      z++;
  }
  if (x == y && y == z)
    cout << s;
  else {
    int k = n / 3;
    for (i = 0; i < n; i++) {
      if (x < k) {
        if (s[i] == '1' && y > k) {
          x++;
          s[i] = '0';
          y--;
        } else if (s[i] == '2' && z > k) {
          x++;
          s[i] = '0';
          z--;
        }
      } else if (z < k) {
        if (s[i] == '0' && x > k) {
          for (j = n - 1; j >= 0; j--) {
            if (s[j] == '0') break;
          }
          s[j] = '2';
          x--;
          z++;
        } else if (s[i] == '1' && y > k) {
          for (j = n - 1; j >= 0; j--) {
            if (s[j] == '1') break;
          }
          s[j] = '2';
          y--;
          z++;
        }
      } else if (y < k) {
        if (s[i] == '2' && z > k) {
          y++;
          s[i] = '1';
          z--;
        } else if (s[n - 1 - i] == '0' && x > k) {
          for (j = n - 1; j >= 0; j--) {
            if (s[j] == '0') break;
          }
          s[j] = '1';
          y++;
          x--;
        }
      }
    }
    cout << s;
  }
}
