#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5;
int n, k;
string a, b, c;
void Print() {
  int i;
  for (i = 0; i < n; i++)
    if (c[i] != '0') break;
  cout << n - i << endl;
  for (; i < n; i++) printf("%c", c[i]);
}
int main() {
  scanf("%d%d", &n, &k);
  cin >> a;
  b = a;
  for (int i = 0; i < k; i++)
    for (int j = i; j < n; j += k) b[j] = a[i];
  if (b >= a) {
    cout << n << endl << b;
    return 0;
  }
  for (int i = k - 1; i >= 0; i--) {
    c = b;
    for (int s = a[i] - '0' + 1; s <= 9; s++) {
      for (int j = i; j < n; j += k) c[j] = s + '0';
      if (c == a) {
        Print();
        return 0;
      }
      if (c > a) {
        for (int w = i + 1; w < k; w++)
          for (int e = w; e < n; e += k) c[e] = '0';
        Print();
        return 0;
      }
    }
  }
}
