#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
const long long MOD = 1e9 + 7;
map<int, int> m1, m2;
long long a[N], b[N];
int n, m;
int f;
vector<pair<long long, long long> > out, in;
vector<long long> ans1, ans2, ans3;
long long x, mod;
string s, t;
int k;
int main() {
  cin >> n >> k;
  cin >> s;
  cout << n << endl;
  t = s.substr(0, k);
  for (int i = k; i < n; i++) {
    t += t[i - k];
  }
  if (t >= s)
    cout << t << endl;
  else {
    for (int i = k - 1; i >= 0; i--) {
      if (t[i] == '9') {
        t[i] = '0';
      } else {
        ++t[i];
        break;
      }
    }
    for (int i = k; i <= n; i++) {
      t[i] = t[i - k];
    }
    cout << t << endl;
  }
}
