#include <bits/stdc++.h>
#pragma GCC optimize("-O2")
using namespace std;
const int LIM = 1e5 + 5, MOD = 1e9 + 7;
const long double EPS = 1e-9;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int tests = 1;
  while (tests--) {
    long long n, k;
    cin >> n >> k;
    string s;
    cin >> s;
    string l = s;
    for (int i = 0; i < k; ++i) {
      l[i] = s[i];
      int j = k;
      while ((i + j) < l.length()) {
        l[i + j] = l[i];
        j += k;
      }
    }
    bool p = 1;
    bool greater = 0;
    for (int i = 0; i < l.length(); ++i) {
      if (l[i] > s[i]) greater = 1;
      if (greater == 0 && l[i] < s[i]) {
        p = 0;
      }
    }
    if (p) {
      cout << l.length() << '\n';
      cout << l << '\n';
    } else {
      bool check = 0;
      for (int i = 0; i < l.length(); ++i) {
        if (s[i] != '9') check = 1;
      }
      string l;
      if (check) {
        l = s;
        int ptr = k - 1;
        while (ptr >= 0) {
          if (l[ptr] < '9') {
            l[ptr]++;
            break;
          } else {
            l[ptr] = '0';
          }
          ptr--;
        }
        for (int i = 0; i < k; ++i) {
          int j = k;
          while ((i + j) < l.length()) {
            l[i + j] = l[i];
            j += k;
          }
        }
      } else {
        for (int i = 0; i < 1 + s.length(); ++i) {
          if (i % k == 0)
            l += '1';
          else
            l += '0';
        }
      }
      cout << l.length() << '\n';
      cout << l << '\n';
    }
  }
  return 0;
}
