#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n, m, k, top, a[N];
pair<int, int> op[N * 3];
int main() {
  scanf("%d%*d%d%d", &n, &m, &k);
  k--;
  m /= 2;
  if (!k) {
    return puts("0 0\n"), 0;
  }
  for (int i = (int)(1); i <= (int)(n); i++) {
    int x;
    scanf("%*d%d", &x);
    a[i] = (x %= m);
    int l = (x + 1) % m, r = (x + k) % m;
    op[++top] = pair<int, int>(l, 1);
    op[++top] = pair<int, int>(r + 1, -1);
    if (l > r) op[++top] = pair<int, int>(0, 1);
  }
  op[++top] = pair<int, int>(m, 0);
  sort(op + 1, op + top + 1);
  int mnv = 1 << 30, mnp = 0, s = 0;
  for (int i = (int)(1); i <= (int)(top - 1); i++) {
    s += op[i].second;
    if (op[i].first != op[i + 1].first) {
      if (s < mnv) mnv = s, mnp = op[i].first;
    }
  }
  cout << mnv << ' ' << mnp << endl;
  for (int i = (int)(1); i <= (int)(n); i++) {
    int d = (mnp + m - a[i]) % m;
    if (d >= 1 && d <= k) cout << i << ' ';
  }
}
