#include <bits/stdc++.h>
using namespace std;
int n, k;
string x;
string ans;
bool valid() {
  for (int i = 0; i < n - k; ++i) {
    ans[i + k] = ans[i];
  }
  bool found_larger = false;
  for (int i = 0; i < n; ++i) {
    if (ans[i] < x[i]) {
      if (!found_larger) {
        return false;
      }
    } else if (ans[i] > x[i]) {
      found_larger = true;
    }
  }
  return true;
}
int main(int argc, char* argv[]) {
  ios::sync_with_stdio(false);
  cin >> n >> k;
  cin >> x;
  ans = x;
  int pos = k - 1;
  while (true) {
    if (valid()) {
      break;
    }
    while (pos >= 0 && ans[pos] == '9') {
      ans[pos] = '0';
      --pos;
    }
    if (pos == -1) {
      ans.insert(0, "1");
    } else {
      ++ans[pos];
    }
  }
  cout << ans.length() << endl;
  cout << ans << endl;
  return 0;
}
