#include <bits/stdc++.h>
using namespace std;
int N, H, M, K;
struct node {
  int ti;
  int id;
  friend bool operator<(node a, node b) { return a.ti < b.ti; }
} bin[100010 * 2];
int maxt, maxid;
bool vis[100010];
queue<int> q;
void work() {
  maxt = 0, maxid = 0;
  int len = M / 2 - K;
  for (int i = 1; i <= N * 2; i++) {
    while (!q.empty() && bin[i].ti - bin[q.front()].ti > len) q.pop();
    q.push(i);
    if (q.size() > maxt) maxt = q.size(), maxid = q.front();
  }
  for (int i = maxid;; i++) {
    if (bin[i].ti - bin[maxid].ti > len) break;
    vis[bin[i].id] = 1;
  }
  printf("%d %d\n", N - maxt, bin[maxid].ti % (M / 2));
  bool flg = 0;
  for (int i = 1; i <= N; i++) {
    if (!vis[i]) {
      if (flg)
        printf(" %d", i);
      else
        printf("%d", i), flg = 1;
    }
  }
}
signed main() {
  scanf("%d %d %d %d", &N, &H, &M, &K);
  for (int i = 1; i <= N; i++) {
    int h, m;
    scanf("%d %d", &h, &m);
    bin[i].id = i, bin[i].ti = m % (M / 2);
  }
  sort(bin + 1, bin + 1 + N);
  for (int i = 1; i <= N; i++) {
    bin[i + N].id = bin[i].id;
    bin[i + N].ti = bin[i].ti + (M / 2);
  }
  work();
  return 0;
}
