#include <bits/stdc++.h>
using namespace std;
int main() {
  int l;
  cin >> l;
  string s;
  cin >> s;
  if (s.size() == l) {
    int z = l - 1;
    while (s[z] == '9' && z > -1) {
      s[z] = '0';
      z--;
    }
    if (z == -1) {
      cout << '1';
      for (int i = 0; i < l; i++) cout << '0';
      return 0;
    }
    s[z] = s[z] + 1;
    for (int i = 0; i <= z; i++) {
      cout << s[i];
    }
    for (int i = z + 1; i < l; i++) cout << '0';
    return 0;
  }
  if (s.size() % l > 0) {
    long long temp = s.size();
    while (temp > 0) {
      cout << '1';
      for (int i = 1; i < l; i++) cout << '0';
      temp -= l;
    }
    return 0;
  } else {
    string g;
    int j = l - 1;
    bool b = 1, c = 0, d = 0;
    g = s.substr(0, l);
    for (int k = 1; k < (s.size() / l); k++) {
      c = 0;
      for (int i = l * k; i < (k + 1) * l; i++) {
        if ((g[i % l] < s[i]) && c == 0 && d == 0) {
          b = 0;
        }
        if (g[i % l] > s[i]) d = 1;
        if (g[i % l] >= s[i]) c = 1;
      }
    }
    if (b && d) {
      for (int i = 0; i < (s.size() / l); i++) cout << g;
      return 0;
    }
    while (j > -1 && s[j] == '9') {
      j--;
    }
    if (j == -1) {
      long long temp = s.size();
      while (temp >= 0) {
        cout << '1';
        for (int i = 1; i < l; i++) cout << '0';
        temp -= l;
      }
    } else {
      int z = l - 1;
      while (g[z] == '9' && z > -1) {
        g[z] = '0';
        z--;
      }
      g[z] = g[z] + 1;
      for (int i = 0; i < s.size(); i += l) cout << g;
    }
  }
  return 0;
}
