#include <bits/stdc++.h>
using namespace std;
const int mx1 = 30;
const int mx2 = 105;
const int mx3 = 2005;
const int mx4 = 30005;
const int mx5 = 300005;
const int mx6 = 1500005;
int _toggle(int N, int pos) { return N = N ^ (1 << pos); }
int _set(int N, int pos) { return N = N | (1 << pos); }
int _reset(int N, int pos) { return N = N & ~(1 << pos); }
bool _check(int N, int pos) { return (bool)(N & (1 << pos)); }
bool _upper(char a) { return a >= 'A' && a <= 'Z'; }
bool _lower(char a) { return a >= 'a' && a <= 'z'; }
bool _digit(char a) { return a >= '0' && a <= '9'; }
int dx[] = {1, -1, 0, 0, -1, -1, 1, 1};
int dy[] = {0, 0, 1, -1, -1, 1, -1, 1};
int n, k;
string s;
void solve() {
  cin >> n >> k >> s;
  string t = s.substr(0, k);
  for (int i = k; i < n; i++) {
    t.push_back(t[i - k]);
  }
  cout << n << '\n';
  if (t >= s) {
    cout << t << '\n';
    return;
  }
  bool f = 0;
  for (int i = 0; i < k; i++) {
    if (t[i] < '9') {
      f = 1;
    }
  }
  for (int i = k - 1; i >= 0; i--) {
    if (t[i] < '9') {
      t[i]++;
      break;
    } else if (f) {
      t[i] = '0';
    }
  }
  for (int i = k; i < n; i++) {
    t[i] = t[i - k];
  }
  cout << t << '\n';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int tc = 1;
  while (tc--) {
    solve();
  }
}
