#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-10;
const long long mod = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const int maxn = 100005;
long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
void print(int x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) print(x / 10);
  putchar(x % 10 - '0');
}
int l;
char a[maxn];
vector<char> v;
int main(void) {
  scanf("%d%s", &l, a + 1);
  int len = strlen(a + 1);
  if (l <= len) {
    int f = 0;
    for (int i = 1; i <= l; i++) {
      v.push_back(a[i]);
      if (a[i] != '9') f = 1;
    }
    if (len % l == 0) {
      if (f) {
        int flag = 0;
        for (int j = 1; j <= len / l - 1; j++) {
          for (int i = j * l + 1; i <= (j + 1) * l; i++) {
            if (a[i] < a[i - j * l]) {
              flag = 1;
              break;
            } else if (a[i] == a[i - j * l]) {
              continue;
            } else {
              flag = -1;
              break;
            }
          }
          if (flag) break;
        }
        if (flag != 1) {
          int p = l - 1;
          while (p >= 0) {
            if (v[p] != '9') {
              v[p]++;
              break;
            } else {
              v[p] = '0';
              p--;
            }
          }
          for (int j = 1; j <= len / l - 1; j++) {
            for (int i = 0; i < l; i++) {
              v.push_back(v[i]);
            }
          }
        } else {
          for (int j = 1; j <= len / l - 1; j++) {
            for (int i = 0; i < l; i++) {
              v.push_back(v[i]);
            }
          }
        }
      } else {
        v.clear();
        v.push_back('1');
        for (int i = 1; i < l; i++) v.push_back('0');
        for (int j = 1; j <= len / l; j++) {
          for (int i = 0; i < l; i++) {
            v.push_back(v[i]);
          }
        }
      }
    } else {
      v.clear();
      v.push_back('1');
      for (int i = 1; i < l; i++) v.push_back('0');
      for (int j = 1; j <= len / l; j++) {
        for (int i = 0; i < l; i++) {
          v.push_back(v[i]);
        }
      }
    }
  } else {
    v.clear();
    v.push_back('1');
    for (int i = 1; i < l; i++) {
      v.push_back('0');
    }
  }
  for (int i = 0; i < v.size(); i++) printf("%c", v[i]);
  puts("");
  return 0;
}
