#include <bits/stdc++.h>
using namespace std;
string a, s[200010];
int main() {
  int n, k;
  cin >> n >> k;
  cin >> a;
  bool t = true;
  for (int i = 0; i < n; i++) {
    if (a[i] < a[i % k]) break;
    if (a[i] > a[i % k]) {
      t = false;
      break;
    }
  }
  cout << n << endl;
  if (t) {
    for (int i = 0; i < n; i++) cout << a[i % k];
  } else {
    for (int i = k - 1; i >= 0; i--) {
      if (a[i] != '9') {
        a[i]++;
        for (int j = i + 1; j < k; j++) a[j] = '0';
        break;
      }
    }
    for (int i = 0; i < n; i++) cout << a[i % k];
  }
}
