#include <bits/stdc++.h>
using namespace std;
string splus(string a, int l) {
  l--;
  while ((l >= 0) && a[l] + 1 > '9') {
    a[l] = '0';
    l--;
  }
  if (l == -1) {
    string ans;
    ans.push_back('1');
    return ans + a;
  }
  a[l]++;
  return a;
}
int main() {
  int l;
  cin >> l;
  string a;
  cin >> a;
  int n = a.length();
  bool f = 0;
label:
  if (a.length() % l) {
    string ans;
    ans.push_back('1');
    for (int i = 0; i < l - 1; i++) ans.push_back('0');
    for (int i = 0; i <= a.length() / l; i++) cout << ans;
    cout << endl;
    return 0;
  }
  for (int i = l; i < a.length(); i++) {
    if (a[i] == a[i - l])
      continue;
    else if (a[i] < a[i - l]) {
      a[i] = a[i - l];
      f = 1;
    } else {
      if (f)
        a[i] = a[i - l];
      else {
        a = splus(a, l);
        if (a.length() > n) goto label;
        f = 1;
        i = l - 1;
      }
    }
  }
  if (f)
    cout << a << endl;
  else {
    a = splus(a, l);
    if (a.length() > n) goto label;
    for (int i = l; i < a.length(); i++) a[i] = a[i - l];
    cout << a << endl;
  }
  return 0;
}
