#include <bits/stdc++.h>
using namespace std;
const long double PI = 3.1415926535897923846;
const long long int MOD = 1000000007;
const long long int N = 998244353;
long long int power(long long int x, long long int n) {
  long long int res = 1;
  while (n > 0) {
    if (n & 1) res = res * x % MOD;
    x = x * x % MOD;
    n >>= 1;
  }
  return res;
}
long long int modinverse(long long int a) { return power(a, MOD - 2); }
void solve() {
  long long int a, n;
  string str;
  cin >> a >> str;
  n = str.length();
  if (n % a) {
    long long int times = n / a + 1;
    for (long long int i = 1; i <= times; i++) {
      for (long long int j = 0; j < a; j++) {
        if (!j)
          cout << 1;
        else
          cout << 0;
      }
    }
    cout << endl;
  } else {
    bool bad_luck = true;
    for (long long int i = a; i < n; i++) {
      if (str[i] != str[i % a]) {
        if (str[i] > str[i % a])
          bad_luck = true;
        else
          bad_luck = false;
        break;
      }
    }
    if (!bad_luck) {
      for (long long int i = 0; i < (n / a); i++)
        for (long long int j = 0; j < a; j++) cout << str[j];
      cout << endl;
      return;
    }
    if (str[a - 1] != '9') {
      str[a - 1] += 1;
      for (long long int i = 0; i < (n / a); i++)
        for (long long int j = 0; j < a; j++) cout << str[j];
      cout << endl;
    } else {
      long long int count = 0;
      for (long long int i = n - 1; i >= 0; i--) {
        if (str[i] != '9') break;
        count++;
      }
      if (count == n) {
        long long int times = n / a + 1;
        for (long long int i = 1; i <= times; i++) {
          for (long long int j = 0; j < a; j++) {
            if (!j)
              cout << 1;
            else
              cout << 0;
          }
        }
        cout << endl;
        return;
      } else {
        long long int shoot = a - 1;
        for (long long int i = a - 1; i >= 0; i--) {
          if (str[i] != '9') {
            shoot = i;
            str[i] = str[i] + 1;
            break;
          }
        }
        for (long long int i = shoot + 1; shoot < a; shoot++) str[i] = '0';
        for (long long int i = 0; i < (n / a); i++)
          for (long long int j = 0; j < a; j++) cout << str[j];
        cout << endl;
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int test = 1;
  while (test--) {
    solve();
  }
  cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC
       << "ms\n";
}
