#include <bits/stdc++.h>
using namespace std;
int a, b;
int main() {
  cin >> a >> b;
  string x;
  cin >> x;
  string q = "";
  for (int i = 0; i < a; i++) {
    q += x[i % b];
  }
  if (x <= q) {
    cout << a << endl << q;
    return 0;
  } else {
    string q1 = "";
    int yu = b - 1;
    while (x[yu] == '9') {
      x[yu] = '0';
      yu--;
    }
    x[yu]++;
    for (int i = 0; i < a; i++) {
      q1 += x[i % b];
    }
    cout << a << endl << q1;
  }
}
