#include <bits/stdc++.h>
using namespace std;
int main() {
  char c1[200005];
  char c2[200005];
  int n, k;
  cin >> n >> k;
  cin >> c1;
  for (int i = 0; i < k; i++) {
    c2[i] = c1[i];
  }
  int flag = 1;
  while (flag) {
    for (int i = 0; i < n; i++) {
      if (c2[i % k] > c1[i]) {
        flag = 0;
        break;
      }
      if (c2[i % k] < c1[i]) {
        c2[k - 1] += 1;
        for (int j = k - 1; j > 0; j--) {
          if (c2[j] == '9' + 1) {
            c2[j] = '0';
            c2[j - 1] += 1;
          }
        }
        break;
      }
      if (i == n - 1) flag = 0;
    }
  }
  cout << n << endl;
  for (int i = 0; i < n; i++) {
    cout << c2[i % k];
  }
  cout << endl;
}
