#include <bits/stdc++.h>
using namespace std;
inline int gi() {
  char c;
  int num = 0, flg = 1;
  while ((c = getchar()) < '0' || c > '9')
    if (c == '-') flg = -1;
  while (c >= '0' && c <= '9') {
    num = num * 10 + c - 48;
    c = getchar();
  }
  return num * flg;
}
const int INF = 1000000000;
long long val[200005];
map<long long, int> last;
struct node {
  int l, r;
  long long la, x;
} a[200005 << 2];
int sl[200005], topl, sr[200005], topr;
void cal(int i, long long k) {
  a[i].la += k;
  a[i].x += k;
}
void pushdown(int i) {
  if (a[i].la && a[i].l < a[i].r) {
    cal(i << 1, a[i].la);
    cal(i << 1 | 1, a[i].la);
    a[i].la = 0;
  }
}
void build(int i, int l, int r) {
  a[i].l = l;
  a[i].r = r;
  if (l == r) {
    a[i].x = l;
    return;
  }
  int mid = (l + r) >> 1;
  build(i << 1, l, mid);
  build(i << 1 | 1, mid + 1, r);
  a[i].x = min(a[i << 1].x, a[i << 1 | 1].x);
}
void insert(int i, int l, int r, long long k) {
  if (a[i].l > r || a[i].r < l) return;
  pushdown(i);
  if (l <= a[i].l && a[i].r <= r) {
    cal(i, k);
    return;
  }
  insert(i << 1, l, r, k);
  insert(i << 1 | 1, l, r, k);
  a[i].x = min(a[i << 1].x, a[i << 1 | 1].x);
}
bool flg;
int ans;
int EF(int i, int k) {
  if (a[i].l == a[i].r) return a[i].l;
  pushdown(i);
  if (a[i << 1].x <= k)
    return EF(i << 1, k);
  else
    return EF(i << 1 | 1, k);
}
void query(int i, int l, int r, int k) {
  if (a[i].l > r || a[i].r < l) return;
  pushdown(i);
  if (l <= a[i].l && a[i].r <= r) {
    if (a[i].x <= k) flg = 1, ans = EF(i, k);
    return;
  }
  if (!flg) query(i << 1, l, r, k);
  if (!flg) query(i << 1 | 1, l, r, k);
}
void del(int i, int x) {
  if (x < a[i].l || x > a[i].r) return;
  pushdown(i);
  if (a[i].l == x && a[i].r == x) {
    a[i].x = 0;
    return;
  }
  del(i << 1, x);
  del(i << 1 | 1, x);
  a[i].x = min(a[i << 1].x, a[i << 1 | 1].x);
}
void print(int i) {
  if (a[i].l == a[i].r) {
    printf("%lld ", a[i].x);
    return;
  }
  pushdown(i);
  print(i << 1);
  print(i << 1 | 1);
}
int main() {
  int n, k, d, i, L, al = 1, ar = 1;
  n = gi();
  k = gi();
  d = gi();
  for (i = 1; i <= n; i++) val[i] = gi() + 1ll * INF;
  if (d == 0) {
    for (i = L = 1; i <= n; i++) {
      while (L <= n && val[L] != val[i]) L++;
      if (ar - al < i - L) al = L, ar = i;
    }
    printf("%d %d", al, ar);
    return 0;
  }
  build(1, 1, n);
  for (i = L = 1; i <= n; i++) {
    int tmp = L;
    if (val[i] % d == val[i - 1] % d)
      L = max(L, last[val[i]] + 1);
    else
      L = i;
    last[val[i]] = i;
    while (tmp < L) del(1, tmp++);
    while (topl && sl[topl] >= L && val[sl[topl]] >= val[i]) {
      insert(1, max(L, sl[topl - 1] + 1), sl[topl], val[sl[topl]] / d);
      topl--;
    }
    insert(1, max(L, sl[topl] + 1), i, -val[i] / d);
    sl[++topl] = i;
    while (topr && sr[topr] >= L && val[sr[topr]] <= val[i]) {
      insert(1, max(L, sr[topr - 1] + 1), sr[topr], -val[sr[topr]] / d);
      topr--;
    }
    insert(1, max(L, sr[topr] + 1), i, val[i] / d);
    sr[++topr] = i;
    flg = 0;
    ans = 0;
    query(1, L, i, k + i);
    if (ar - al < i - ans) al = ans, ar = i;
  }
  printf("%d %d", al, ar);
}
