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-4 -3 -2 -1 0 1 2 10 11 12 13 14 100
 -5 -1 0
 -10 0 0 1 6 2 7
 Incorrect sequence
 -1 0 1 2 3 4
 0
 -10 0 -2 1 -1 2 0 3 1
 3 -2 5 -1 7 0 9 1 11 2
 -11 -2 -10 -1 0 0 10 1 11
 -1 -1 -1 0 0 0 1 1 1
 0 -1 10 0 11 1 12
 1000000000 1000000001 1000000002 1000000003 1000000004
 Incorrect sequence
 -11 -1 -10 0 -1 1 0
 -5 1 -13 -4 2 -12 -3 3 -11 -2 4 -10 -1 5 -9 0 6 -8 1 7 -7 2 8 -6 5 9 -5 6 10 -4 7 11 -3 8 12 -2 10 13 -1
 Incorrect sequence
 -2 -1 0 1 2 3 4
 -10 0 0 1 1 2 2
 -10 0 -7 1 -6 2 -1 3 0
 1 0 -1000000000 2 100 0 3
 -10 0 -3 1 -2 2 -1 3 0
 10 0 11 1 12 2 13 3 14
 -1 0 1
 -2 -1 0 1 2 3 4 5 6 10
 -1000000001 -1 -1000000000 0 0
 -1000000000 1000000000
 -10 0 -7 1 -6 2 0
 -1 0 0 0 2
 10 0 11 1 12 2 13
 -10 0 -2 1 -1 2 0
 -10 0 -1 1 0 2 1
 -11 -1 -10 0 10 1 11
 -3 -2 -1 0 1 3
 -10 0 -1 1 0 2 1 3 10
 Incorrect sequence
 -5 0 -1 -1 1 0 0 5 1
 -3 -2 -1 0 1 2 3 

#include <bits/stdc++.h>
using namespace std;
const long long nmax = 2 * 1e5 + 42, inf = 1e9 + 42;
long long n, k;
string inp[nmax];
pair<long long, long long> seen[nmax];
long long outp[nmax];
long long take(string s) {
  long long mult = 1;
  long long ret = 0;
  for (auto k : s)
    if (k == '-')
      mult = -1;
    else
      ret = ret * 10 + (k - '0');
  return ret * mult;
}
void make(long long i) {
  if (seen[i % k].first >= 0 && outp[i] >= 0) {
    long long now = seen[i % k].first;
    for (long long j = seen[i % k].second + k; j < i; j = j + k) {
      now++;
      outp[j] = now;
    }
    for (long long j = seen[i % k].second + k; j < i && j < n; j = j + k)
      if (j - k >= 0 && outp[j - k] >= outp[j]) assert(0 == 1);
    return;
  }
  if (seen[i % k].first <= 0 && outp[i] <= 0) {
    long long now = outp[i];
    for (long long j = i - k; j > seen[i % k].second; j = j - k) {
      now--;
      outp[j] = now;
    }
    for (long long j = seen[i % k].second + k; j < i && j < n; j = j + k)
      if (j - k >= 0 && outp[j - k] >= outp[j]) {
        cout << ":(" << endl;
        exit(0);
      }
    return;
  }
  long long d = (i - seen[i % k].second) / k - 1;
  if (d == 0) return;
  deque<long long> help = {0};
  for (long long v = 1; help.size() < d; v++) {
    help.push_front(-v);
    if (help.size() == d) break;
    help.push_back(v);
  }
  for (long long p = seen[i % k].second + k; p < i; p = p + k) {
    if (help.size() == 0) {
      cout << "y" << endl;
      exit(0);
    }
    outp[p] = help.front();
    help.pop_front();
  }
  if (help.size()) {
    cout << "qqq" << endl;
    exit(0);
  }
  for (long long j = seen[i % k].second + k; j < i && j < n; j = j + k)
    if (j - k >= 0 && outp[j - k] >= outp[j]) {
      cout << ":(" << endl;
      exit(0);
    }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie();
  cout.tie();
  cin >> n >> k;
  for (long long i = 0; i < n; i++) cin >> inp[i];
  for (long long i = 0; i < k; i++) seen[i] = {-(inf), i - k};
  for (long long i = 0; i < n; i++)
    if (inp[i] != "?") {
      outp[i] = take(inp[i]);
      if (seen[i % k].first + (i - seen[i % k].second) / k <= outp[i]) {
        make(i);
      } else {
        cout << "Incorrect sequence" << endl;
        return 0;
      }
      seen[i % k] = {outp[i], i};
    }
  for (long long i = n; i - k + 1 <= n; i++)
    if (seen[i % k].second + k != i) {
      outp[i] = inf;
      make(i);
    }
  for (long long i = 0; i < n; i++) cout << outp[i] << " ";
  cout << endl;
  return 0;
}
