#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T& a, const T& b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
const long long int MOD = 1e9 + 7, INF = 1e18;
long long int dx[8] = {0, -1, 1, 0, 1, -1, 1, -1},
              dy[8] = {1, 0, 0, -1, -1, -1, 1, 1};
long long int N, arr[300000], cnt[3];
vector<long long int> pos[3];
int main() {
  cin >> N;
  for (long long int i = (0), i_end_ = (N); i < i_end_; i++) {
    char c;
    cin >> c;
    arr[i] = c - '0';
    pos[arr[i]].push_back(i);
  }
  if (((long long int)(pos[0]).size()) < N / 3) {
    if (((long long int)(pos[1]).size()) <= N / 3) {
      long long int idx = 0;
      for (long long int i = (0),
                         i_end_ = (N / 3 - ((long long int)(pos[0]).size()));
           i < i_end_; i++) {
        arr[pos[2][idx]] = 0;
        idx++;
      }
      for (long long int i = (0),
                         i_end_ = (N / 3 - ((long long int)(pos[1]).size()));
           i < i_end_; i++) {
        arr[pos[2][idx]] = 1;
        idx++;
      }
    } else if (((long long int)(pos[2]).size()) < N / 3) {
      long long int idx = 0, _idx = 0;
      for (long long int i = (0),
                         i_end_ = (N / 3 - ((long long int)(pos[0]).size()));
           i < i_end_; i++) {
        arr[pos[1][idx]] = 0;
        idx++;
      }
      for (long long int i = (0),
                         i_end_ = (N / 3 - ((long long int)(pos[2]).size()));
           i < i_end_; i++) {
        arr[pos[1][((long long int)(pos[1]).size()) - _idx - 1]] = 2;
        _idx++;
      }
    } else {
      for (long long int i = (0),
                         i_end_ = (((long long int)(pos[1]).size()) - N / 3);
           i < i_end_; i++) {
        arr[pos[1][i]] = 0;
      }
      for (long long int i = (0),
                         i_end_ = (((long long int)(pos[2]).size()) - N / 3);
           i < i_end_; i++) {
        arr[pos[2][i]] = 0;
      }
    }
  } else if (((long long int)(pos[1]).size()) < N / 3) {
    if (((long long int)(pos[2]).size()) < N / 3) {
      long long int idx = 0;
      for (long long int i = (0),
                         i_end_ = (N / 3 - ((long long int)(pos[2]).size()));
           i < i_end_; i++) {
        arr[pos[0][((long long int)(pos[0]).size()) - idx - 1]] = 2;
        idx++;
      }
      for (long long int i = (0),
                         i_end_ = (N / 3 - ((long long int)(pos[1]).size()));
           i < i_end_; i++) {
        arr[pos[0][((long long int)(pos[0]).size()) - idx - 1]] = 1;
        idx++;
      }
    } else {
      for (long long int i = (0),
                         i_end_ = (((long long int)(pos[2]).size()) - N / 3);
           i < i_end_; i++) {
        arr[pos[2][i]] = 1;
      }
      for (long long int i = (0),
                         i_end_ = (((long long int)(pos[0]).size()) - N / 3);
           i < i_end_; i++) {
        arr[pos[0][((long long int)(pos[0]).size()) - i - 1]] = 1;
      }
    }
  } else {
    for (long long int i = (0),
                       i_end_ = (((long long int)(pos[0]).size()) - N / 3);
         i < i_end_; i++) {
      arr[pos[0][((long long int)(pos[0]).size()) - i - 1]] = 2;
    }
    for (long long int i = (0),
                       i_end_ = (((long long int)(pos[1]).size()) - N / 3);
         i < i_end_; i++) {
      arr[pos[1][((long long int)(pos[1]).size()) - i - 1]] = 2;
    }
  }
  for (long long int i = (0), i_end_ = (N); i < i_end_; i++) {
    cout << arr[i];
  }
  cout << '\n';
}
