#include <bits/stdc++.h>
using namespace std;
string add(string s1) {
  string s;
  int c = 1, x;
  for (int j = s1.size() - 1; j >= 0; j--) {
    x = s1[j] - '0' + c;
    s += x % 10 + '0';
    c = x / 10;
  }
  if (c) s += c + '0';
  reverse(s.begin(), s.end());
  return s;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, l = 0;
  string s, second;
  cin >> n >> s;
  second = s;
  sort(second.begin(), second.end());
  if (s.size() % n || second[0] == second[s.size() - 1]) {
    l = s.size() / n + 1;
    for (int i = 0; i < l; i++) {
      cout << "1";
      for (int i = 1; i < n; i++) cout << "0";
    }
    cout << endl;
  } else {
    second.clear();
    for (int i = 0; i < n; i++) second += s[i];
    string res;
    for (int i = 1; i <= s.size() / n; i++) {
      res += second;
    }
    if (res > s)
      cout << res << endl;
    else {
      res = add(second);
      for (int i = 0; i < s.size() / n; i++) cout << res;
      cout << endl;
    }
  }
}
