#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
const int MAX = 30;
const int inf = 0x3f3f3f3f;
int a[maxn];
signed main() {
  int n, m;
  cin >> n >> m;
  char c = getchar();
  for (int i = (1); i <= (n); ++i) {
    c = getchar();
    a[i - 1] = c - '0';
  }
  int pos = m;
  while (pos < n) {
    int ori = pos % m;
    if (a[ori] == a[pos])
      pos++;
    else if (a[ori] > a[pos])
      break;
    else {
      a[m - 1]++;
      for (int i = (m - 1); i >= (1); --i) {
        a[i - 1] += a[i] / 10;
        a[i] %= 10;
      }
      break;
    }
  }
  printf("%d\n", n);
  pos = 0;
  for (int i = (1); i <= (n); ++i) {
    printf("%d", a[pos]);
    pos = (pos + 1) % m;
  }
}
