#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  bool ok = true;
  for (int i = 0; i < n; i++) {
    if (s[i] != s[i % k]) {
      ok = false;
      break;
    }
  }
  if (ok) {
    cout << n << endl;
    cout << s << endl;
  } else {
    string res = "";
    for (int i = 0; i < n; i++) res += s[i % k];
    if (res <= s) {
      s[k - 1]++;
      for (int i = k - 1; i > 0; i--) {
        if (s[i] > '9') {
          s[i] = '0';
          s[i - 1]++;
        } else {
          break;
        }
      }
    }
    for (int i = 0; i < n; i++) res[i] = s[i % k];
    cout << n << endl;
    cout << res << endl;
  }
}
