#include <bits/stdc++.h>
#include <climits>
using namespace std;
constexpr int maxk = 101 + 5;
inline bool IsNoInRange(int n, int k) {
return n >= 1 && n <= k;
}
vector<int> Solve() {
int n, m, k;
cin >> n >> m >> k;
vector<int> seq(n);
for (int& si : seq) {
cin >> si;
si = (si % m) + 1;
}
for (int si : seq) {
cout << si << " ";
}
cout << '\n';
int mark[maxk] = {};
int ptr = 0, cnt = 0;
int len = INT_MAX, a = -1, b = -1;
for (int i = 0; i < n; ++i) {
if (IsNoInRange(seq[i], k)) {
if (mark[seq[i]] == 0) {
++cnt;
}
mark[seq[i]]++;
}
while (cnt == k && ptr < i) {
bool flag = false;
if (!IsNoInRange(seq[ptr], k)) {
flag = true;
} else if (mark[seq[ptr]] > 1) {
flag = true;
mark[seq[ptr]]--;
}
if (!flag) break;
++ptr;
}
if (cnt == k) {
int cur_len = i - ptr + 1;
if (cur_len < len) {
len = cur_len;
a = ptr + 1;
b = i + 1;
} else if (cur_len == len && ptr + 1 < a) {
a = ptr + 1;
b = i + 1;
}
}
}
return {len, a, b};
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
auto ans = Solve();
cout << (ans[0] == INT_MAX ? "Rango no encontrado"
: to_string(ans[1]) + " " + to_string(ans[2])) << '\n';
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CiNpbmNsdWRlIDxjbGltaXRzPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmNvbnN0ZXhwciBpbnQgbWF4ayA9IDEwMSArIDU7CgppbmxpbmUgYm9vbCBJc05vSW5SYW5nZShpbnQgbiwgaW50IGspIHsKICByZXR1cm4gbiA+PSAxICYmIG4gPD0gazsKfQoKdmVjdG9yPGludD4gU29sdmUoKSB7CiAgaW50IG4sIG0sIGs7CiAgY2luID4+IG4gPj4gbSA+PiBrOwogIHZlY3RvcjxpbnQ+IHNlcShuKTsKICBmb3IgKGludCYgc2kgOiBzZXEpIHsKICAJY2luID4+IHNpOwogIAlzaSA9IChzaSAlIG0pICsgMTsKICB9CiAgZm9yIChpbnQgc2kgOiBzZXEpIHsKICAJY291dCA8PCBzaSA8PCAiICI7CiAgfQogIGNvdXQgPDwgJ1xuJzsKICAKICBpbnQgbWFya1ttYXhrXSA9IHt9OwogIGludCBwdHIgPSAwLCBjbnQgPSAwOwogIGludCBsZW4gPSBJTlRfTUFYLCBhID0gLTEsIGIgPSAtMTsKCiAgZm9yIChpbnQgaSA9IDA7IGkgPCBuOyArK2kpIHsKICAgIGlmIChJc05vSW5SYW5nZShzZXFbaV0sIGspKSB7CiAgICAgIGlmIChtYXJrW3NlcVtpXV0gPT0gMCkgewogICAgICAgICsrY250OwogICAgICB9CiAgICAgIG1hcmtbc2VxW2ldXSsrOwogICAgfQogICAgd2hpbGUgKGNudCA9PSBrICYmIHB0ciA8IGkpIHsKICAgICAgYm9vbCBmbGFnID0gZmFsc2U7CiAgICAgIGlmICghSXNOb0luUmFuZ2Uoc2VxW3B0cl0sIGspKSB7CiAgICAgICAgZmxhZyA9IHRydWU7CiAgICAgIH0gZWxzZSBpZiAobWFya1tzZXFbcHRyXV0gPiAxKSB7CiAgICAgICAgZmxhZyA9IHRydWU7CiAgICAgICAgbWFya1tzZXFbcHRyXV0tLTsKICAgICAgfQogICAgICBpZiAoIWZsYWcpIGJyZWFrOwogICAgICArK3B0cjsKICAgIH0KICAgIGlmIChjbnQgPT0gaykgewogICAgICBpbnQgY3VyX2xlbiA9IGkgLSBwdHIgKyAxOwogICAgICBpZiAoY3VyX2xlbiA8IGxlbikgewogICAgICAJbGVuID0gY3VyX2xlbjsKICAgICAgCWEgPSBwdHIgKyAxOwogICAgICAJYiA9IGkgKyAxOwogICAgICB9IGVsc2UgaWYgKGN1cl9sZW4gPT0gbGVuICYmIHB0ciArIDEgPCBhKSB7CiAgICAgIAlhID0gcHRyICsgMTsKICAgICAgCWIgPSBpICsgMTsKICAgICAgfQogICAgfQogIH0KCiAgcmV0dXJuIHtsZW4sIGEsIGJ9Owp9CgppbnQgbWFpbigpIHsKICBpb3NfYmFzZTo6c3luY193aXRoX3N0ZGlvKDApOwogIGNpbi50aWUoMCk7CgogIGF1dG8gYW5zID0gU29sdmUoKTsKICBjb3V0IDw8IChhbnNbMF0gPT0gSU5UX01BWCA/ICJSYW5nbyBubyBlbmNvbnRyYWRvIgogICAgOiB0b19zdHJpbmcoYW5zWzFdKSArICIgIiArIHRvX3N0cmluZyhhbnNbMl0pKSA8PCAnXG4nOwoKICByZXR1cm4gMDsKfQo=