#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int req = n / 3;
  vector<set<int>> nums(3);
  int zero = 0;
  int one = 0;
  int two = 0;
  for (int i = 0; i < n; i++) {
    nums[s[i] - '0'].insert(i);
    if (s[i] - '0' == 0)
      zero++;
    else if (s[i] - '0' == 1)
      one++;
    else
      two++;
  }
  while (zero < req) {
    int minIndex = n + 1;
    int rem = -1;
    if (one > req) {
      minIndex = min(minIndex, *nums[1].begin());
      rem = 1;
    }
    if (two > req && *nums[2].begin() < minIndex) {
      minIndex = min(minIndex, *nums[2].begin());
      rem = 2;
    }
    nums[0].insert(minIndex);
    nums[rem].erase(minIndex);
    s[minIndex] = '0';
    if (rem == 1)
      one--;
    else
      two--;
    zero++;
  }
  for (int i = 0; i < req; i++) {
    nums[0].erase(nums[0].begin());
  }
  while (nums[1].size() < req) {
    int minIndex = n + 1;
    int rem = -1;
    if (two > req) {
      minIndex = min(minIndex, *nums[2].begin());
      rem = 2;
    }
    if (zero > req && *nums[0].begin() < minIndex) {
      minIndex = min(minIndex, *nums[0].begin());
      rem = 0;
    }
    nums[1].insert(minIndex);
    nums[rem].erase(minIndex);
    s[minIndex] = '1';
    one++;
    if (rem == 0)
      zero--;
    else
      two--;
  }
  for (int i = 0; i < req; i++) {
    nums[1].erase(nums[1].begin());
  }
  while (nums[2].size() < req) {
    int minIndex = n + 1;
    int rem = -1;
    if (zero > req) {
      minIndex = min(minIndex, *nums[0].begin());
      rem = 0;
    }
    if (one > req && *nums[1].begin() < minIndex) {
      minIndex = min(minIndex, *nums[1].begin());
      rem = 1;
    }
    nums[2].insert(minIndex);
    nums[rem].erase(minIndex);
    s[minIndex] = '2';
    if (rem == 1)
      one--;
    else
      zero--;
    two++;
  }
  cout << s;
}
