#include <bits/stdc++.h>
using namespace std;
struct IO {
  char buf[(1 << 20)], *p1, *p2;
  char pbuf[(1 << 20)], *pp;
  IO() : p1(buf), p2(buf), pp(pbuf) {}
  inline char gc() {
    return getchar();
    if (p1 == p2) p2 = (p1 = buf) + fread(buf, 1, (1 << 20), stdin);
    return p1 == p2 ? ' ' : *p1++;
  }
  inline bool blank(char ch) {
    return ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t';
  }
  template <class T>
  inline void read(T &x) {
    register double tmp = 1;
    register bool sign = 0;
    x = 0;
    register char ch = gc();
    for (; !(ch >= '0' && ch <= '9'); ch = gc())
      if (ch == '-') sign = 1;
    for (; (ch >= '0' && ch <= '9'); ch = gc()) x = x * 10 + (ch - '0');
    if (ch == '.')
      for (ch = gc(); (ch >= '0' && ch <= '9'); ch = gc())
        tmp /= 10.0, x += tmp * (ch - '0');
    if (sign) x = -x;
  }
  inline void read(char *s) {
    register char ch = gc();
    for (; blank(ch); ch = gc())
      ;
    for (; !blank(ch); ch = gc()) *s++ = ch;
    *s = 0;
  }
  inline void read(char &c) {
    for (c = gc(); blank(c); c = gc())
      ;
  }
  template <class t>
  inline void write(t x) {
    if (x < 0)
      putchar('-'), write(-x);
    else {
      if (x > 9) write(x / 10);
      putchar('0' + x % 10);
    }
  }
} io;
const int mod = 1e9 + 7;
const int mo = 998244353;
const int N = 1e5 + 5;
int n, H, m, k, gs, b[N], a[N], C[N], ans;
inline void add(int x) {
  while (x <= gs) {
    C[x]++;
    x += x & (-x);
  }
}
inline int ask(int x) {
  int ret = 0;
  while (x) {
    ret += C[x];
    x -= x & (-x);
  }
  return ret;
}
int main() {
  io.read(n);
  io.read(H);
  io.read(m);
  io.read(k);
  for (int i = (1); i <= (n); i++) {
    int x;
    io.read(x);
    io.read(a[i]);
    a[i] %= (m / 2);
    b[i] = a[i];
  }
  sort(b + 1, b + n + 1);
  gs = unique(b + 1, b + n + 1) - b - 1;
  for (int i = (1); i <= (n); i++) {
    int p = lower_bound(b + 1, b + gs + 1, a[i]) - b;
    add(p);
  }
  int ans = 1e9, T = 0;
  for (int i = (1); i <= (n); i++) {
    int l = lower_bound(b + 1, b + gs + 1, a[i] - k + 1) - b;
    int r = upper_bound(b + 1, b + gs + 1, a[i] - 1) - b - 1;
    int ret = ask(r) - ask(l - 1);
    if (a[i] - k < 0) {
      int l = lower_bound(b + 1, b + gs + 1, a[i] - k + m / 2 + 1) - b;
      ret += ask(gs) - ask(l - 1);
    }
    if (ans > ret) ans = ret, T = a[i];
  }
  printf("%d %d\n", ans, T);
  for (int i = (1); i <= (n); i++)
    if ((a[i] >= T - k + 1 && a[i] < T) || (a[i] > T - k + m / 2))
      printf("%d ", i);
  return 0;
}
