#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const double eps = 1e-9;
string solve(string str, long long n) {
  long long count_0 = count(str.begin(), str.end(), '0');
  long long count_1 = count(str.begin(), str.end(), '1');
  long long count_2 = count(str.begin(), str.end(), '2');
  if ((count_0 == n) && (count_1 == n) && (count_2 == n)) {
    return str;
  } else {
    if (count_0 == n) {
      if (count_1 > n) {
        long long i = 3 * n - 1;
        while (count_1 != n) {
          if (str[i] == '1') {
            str[i] = '2';
            i--;
            count_1--;
          } else {
            i--;
          }
        }
        return str;
      }
      if (count_2 > n) {
        long long i = 0;
        while (count_2 != n) {
          if (str[i] == '2') {
            str[i] = '1';
            i++;
            count_2--;
          } else {
            i++;
          }
        }
        return str;
      }
    }
    if (count_1 == n) {
      if (count_0 > n) {
        long long i = 3 * n - 1;
        while (count_0 != n) {
          if (str[i] == '0') {
            str[i] = '2';
            i--;
            count_0--;
          } else {
            i--;
          }
        }
        return str;
      }
      if (count_2 > n) {
        long long i = 0;
        while (count_2 != n) {
          if (str[i] == '2') {
            str[i] = '0';
            i++;
            count_2--;
          } else {
            i++;
          }
        }
        return str;
      }
    }
    if (count_2 == n) {
      if (count_1 > n) {
        long long i = 0;
        while (count_1 != n) {
          if (str[i] == '1') {
            str[i] = '0';
            i++;
            count_1--;
          } else {
            i++;
          }
        }
        return str;
      }
      if (count_0 > n) {
        long long i = 3 * n - 1;
        while (count_0 != n) {
          if (str[i] == '0') {
            str[i] = '1';
            i--;
            count_0--;
          } else {
            i--;
          }
        }
        return str;
      }
    }
    if ((count_0 > n) && (count_1 > n) && (count_2 < n)) {
      long long i = 3 * n - 1;
      while ((count_0 != n) || (count_1 != n)) {
        if ((str[i] == '0') && (count_0 != n)) {
          str[i] = '2';
          i--;
          count_0--;
        } else if ((str[i] == '1') && (count_1 != n)) {
          str[i] = '2';
          i--;
          count_1--;
        } else {
          i--;
        }
      }
      return str;
    }
    if ((count_0 > n) && (count_1 < n) && (count_2 > n)) {
      long long i = 3 * n - 1;
      long long j = 0;
      while ((count_0 != n) || (count_2 != n)) {
        if (count_0 != n) {
          if (str[i] == '0') {
            str[i] = '1';
            i--;
            count_0--;
          } else {
            i--;
          }
        }
        if (count_2 != n) {
          if (str[j] == '2') {
            str[j] = '1';
            j++;
            count_2--;
          } else {
            j++;
          }
        }
      }
      return str;
    }
    if ((count_0 < n) && (count_1 > n) && (count_2 > n)) {
      long long i = 0;
      while ((count_1 != n) || (count_2 != n)) {
        if ((str[i] == '1') && (count_1 != n)) {
          str[i] = '0';
          i++;
          count_1--;
        } else if ((str[i] == '2') && (count_2 != n)) {
          str[i] = '0';
          i++;
          count_2--;
        } else {
          i++;
        }
      }
      return str;
    }
    if ((count_0 < n) && (count_1 < n) && (count_2 > n)) {
      long long i = 0;
      while (count_2 != n) {
        if (str[i] == '2') {
          if (count_0 != n) {
            str[i] = '0';
            count_2--;
            count_0++;
            i++;
          } else if (count_1 != n) {
            str[i] = '1';
            count_2--;
            count_1++;
            i++;
          }
        } else {
          i++;
        }
      }
      return str;
    }
    if ((count_0 < n) && (count_1 > n) && (count_2 < n)) {
      long long i = 0;
      long long j = 3 * n - 1;
      while (count_1 != n) {
        if (count_0 != n) {
          if (str[i] == '1') {
            str[i] = '0';
            count_1--;
            count_0++;
            i++;
          } else {
            i++;
          }
        }
        if (count_2 != n) {
          if (str[j] == '1') {
            str[j] = '2';
            count_1--;
            count_2++;
            j--;
          } else {
            j--;
          }
        }
      }
      return str;
    }
    if ((count_0 > n) && (count_1 < n) && (count_2 < n)) {
      long long i = 3 * n - 1;
      while (count_0 != n) {
        if (str[i] == '0') {
          if (count_2 != n) {
            str[i] = '2';
            count_2++;
            count_0--;
            i--;
          } else if (count_1 != n) {
            str[i] = '1';
            count_1++;
            count_0--;
            i--;
          }
        } else {
          i--;
        }
      }
      return str;
    }
  }
  return str;
}
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  string str;
  cin >> str;
  n /= 3;
  cout << solve(str, n) << "\n";
  return 0;
}
