#include <bits/stdc++.h>
using namespace std;
const int maxn = 200001;
const int mod = 998244353;
string a, b, c;
int n, k;
void jia() {
  int m = k - 1;
  while (1) {
    if (b[m] <= '8' && b[m] >= '0') {
      b[m]++;
      return;
    } else {
      b[m] = '0';
      m--;
    }
  }
}
int main() {
  scanf("%d%d", &n, &k);
  printf("%d\n", n);
  cin >> a;
  for (int i = 0; i < k; i++) b += a[i];
  for (int i = 1; i <= n / k; i++) c += b;
  for (int i = 0; i < n % k; i++) c += b[i];
  if (c >= a)
    cout << c;
  else {
    jia();
    for (int i = 0; i < n / k; i++) cout << b;
    for (int i = 0; i < n % k; i++) cout << b[i];
  }
  return 0;
}
