#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long MAX = 100005;
const long double PI = 3.14159265359;
const long double G = 9.807;
const long long INF = 1e18;
const long double EPS = 1e-6;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
bool isprime(long long a) {
  if (a == 2) return 1;
  if (!(a & 1)) return 0;
  for (long long i = 3; i * i <= a; i += 2)
    if (a % i == 0) return 0;
  return 1;
}
long long mpow(long long base, long long exponent, long long modulus) {
  if (modulus == 1) return 0;
  long long result = 1;
  base = base % modulus;
  while (exponent) {
    if (exponent % 2 == 1) result = (result * base) % modulus;
    exponent = exponent >> 1;
    base = (base * base) % modulus;
  }
  return result;
}
long long minv(long long a, long long mod) {
  long long _gcd = gcd(a, mod);
  assert(_gcd == 1);
  return mpow(a, mod - 2, mod);
}
long long L;
string s;
void solve(string s) {
  long long ct = 0;
  long long n = s.length();
  string temp;
  for (int i = 0; i < L; i++) {
    temp += s[i];
  }
  long long nice = 0, nope = 0;
  for (int i = 0; i < n; i += L) {
    for (int j = 0; j < L; j++) {
      if (s[i + j] < temp[j]) {
        nice |= (!nope);
      } else if (s[i + j] > temp[j]) {
        nope = 1;
      }
    }
  }
  if (nice) {
    string ans;
    for (int i = 0; i < n / L; i++) {
      ans += temp;
    }
    cout << ans;
  } else {
    for (int i = 0; i < L; i++) {
      if (s[i] == '9') ct++;
    }
    if (ct == L) {
      string S;
      S += '1';
      for (int i = 1; i < n / L * L + L; i++) {
        S += '0';
      }
      s = S;
    }
    n = s.length();
    temp.clear();
    for (int i = 0; i < L; i++) {
      temp += s[i];
    }
    for (int i = 0; i < n; i += L) {
      for (int j = 0; j < L; j++) {
        if (s[i + j] < temp[j]) {
          nice |= (!nope);
        } else if (s[i + j] > temp[j]) {
          nope = 1;
        }
      }
    }
    if (nice) {
      string ans;
      for (int i = 0; i < n / L; i++) ans += temp;
      cout << ans;
    } else {
      for (int i = L - 1; i >= 0; i--) {
        if (temp[i] == '9')
          temp[i] = '0';
        else {
          temp[i]++;
          break;
        }
      }
      string ans;
      for (int i = 0; i < n / L; i++) {
        ans += temp;
      }
      cout << ans;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> L;
  cin >> s;
  long long n = s.length();
  if (n % L == 0) {
    solve(s);
  } else {
    string S;
    S += '1';
    for (int i = 1; i < n / L * L + L; i++) {
      S += '0';
    }
    s = S;
    if (s.length() == L) {
      cout << s;
    } else
      solve(s);
  }
  return 0;
}
