#include <bits/stdc++.h>
using namespace std;
long long a, b, c, d, x, y, z, p, q, l, r, k,
    t = 1, n, m, cnt, curr, prev, ndx, i, j, rem, cnt1, cnt2, tmp, nxt, sum,
    ans, mx, mn;
long long mypow(long long x, long long y) {
  long long res = 1;
  while (y > 0) {
    if (y & 1) res = res * x;
    y = y >> 1;
    x = x * x;
  }
  return res;
}
long long mylog(long long n, long long b) {
  long long cnt = 0;
  while (n > 1) n /= b, cnt++;
  return cnt;
}
bool cmp(vector<long long> v1, vector<long long> v2) {
  if (v1[0] == v2[0]) {
    if (v1[1] == v2[1]) {
      if (v1[2] == v2[2]) {
        return true;
      } else
        return v1[2] < v2[2];
    } else
      return v1[1] < v2[1];
  } else
    return v1[0] < v2[0];
}
pair<long long, long long> manacher(string s) {
  int n = s.size();
  vector<int> d1(n);
  for (int i = 0, l = 0, r = -1; i < n; i++) {
    int k = (i > r) ? 1 : min(d1[l + r - i], r - i + 1);
    while (0 <= i - k && i + k < n && s[i - k] == s[i + k]) {
      k++;
    }
    d1[i] = k--;
    if (i + k > r) {
      l = i - k;
      r = i + k;
    }
  }
  vector<int> d2(n);
  for (int i = 0, l = 0, r = -1; i < n; i++) {
    int k = (i > r) ? 0 : min(d2[l + r - i + 1], r - i + 1);
    while (0 <= i - k - 1 && i + k < n && s[i - k - 1] == s[i + k]) {
      k++;
    }
    d2[i] = k--;
    if (i + k > r) {
      l = i - k - 1;
      r = i + k;
    }
  }
  pair<long long, long long> ret = {0, 0};
  for (long long i = 0; i < n; i++) {
    if (i + 1 == d1[i] && (2 * (d1[i] - 1) + 1) > ret.first)
      ret.first = 2 * (d1[i] - 1) + 1;
    if (i == d2[i] && 2 * d2[i] > ret.first) ret.first = 2 * d2[i];
    if (i + d1[i] == n && (2 * (d1[i] - 1) + 1) > ret.second)
      ret.second = 2 * (d1[i] - 1) + 1;
    if (i + d2[i] == n && 2 * d2[i] > ret.second) ret.second = 2 * d2[i];
  }
  return (ret);
}
bool isprime(long long n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
struct hash_pair {
  template <class T1, class T2>
  size_t operator()(const pair<T1, T2>& p) const {
    auto hash1 = hash<T1>{}(p.first);
    auto hash2 = hash<T2>{}(p.second);
    return hash1 ^ hash2;
  }
};
string s = "", s1 = "", s2 = "";
void solve() {
  cin >> n >> k;
  cin >> s;
  vector<long long> v(n + 2), chk(n, 2);
  for (long long i = 0; i < n; i++) v[i] = s[i] - '0';
  for (long long i = 0; i < k - 1; i++) {
    x = v[i];
    for (long long j = i; j < n; j += k) {
      if (v[j] > x)
        chk[j] = -1;
      else if (v[j] < x)
        chk[j] = 1;
      else
        chk[j] = 0;
      v[j] = x;
    }
  }
  x = v[k - 1];
  for (long long i = k; i < n; i++) {
    if (chk[i] == 1) {
      break;
    } else if (chk[i] == -1) {
      x += 1;
      break;
    } else if (chk[i] == 2) {
      if (v[i] > x) {
        x += 1;
        break;
      } else if (v[i] < x) {
        break;
      }
    }
  }
  if (x == 10) {
    x = 0;
    long long carry = 1;
    for (long long i = k - 1; i >= 0; i--) {
      v[i] += 1;
      if (v[i] == 10) {
        v[i] = 0;
        carry = 1;
      } else {
        carry = 0;
        break;
      }
    }
    if (carry == 1) {
      n += 1;
      v[0] = 1;
      for (long long i = 1; i < k; i++) v[i] = 0;
    }
  } else
    v[k - 1] = x;
  for (long long i = 0; i < k; i++) {
    x = v[i];
    for (long long j = i; j < n; j += k) {
      v[j] = x;
    }
  }
  cout << n << endl;
  for (long long i = 0; i < n; i++) cout << v[i];
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  while (t--) solve();
}
