#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int T = 1;
  for (int test_case = 1; test_case <= T; ++test_case) {
    int n, k;
    string s;
    cin >> n >> k >> s;
    s = '$' + s;
    string init = s;
    for (int i = k + 1; i <= n; ++i) {
      s[i] = s[i - k];
    }
    bool can = true;
    for (int i = 1; i <= n; ++i) {
      if ((s[i] - '0') < (init[i] - '0')) {
        can = false;
        break;
      } else {
        if ((s[i] - '0') > (init[i] - '0')) {
          break;
        }
      }
    }
    if (can) {
      cout << n << '\n' << s.substr(1, n) << '\n';
    } else {
      for (int i = k; i >= 1; --i) {
        if (s[i] != '9') {
          ++s[i];
          for (int j = i + 1; j <= k; ++j) {
            s[j] = '0';
          }
          break;
        }
      }
      for (int i = k + 1; i <= n; ++i) {
        s[i] = s[i - k];
      }
      cout << n << '\n' << s.substr(1, n) << '\n';
    }
  }
}
