#include <bits/stdc++.h>
using namespace std;
using big = long long;
int n, h, m, k;
const int N = 300200;
big a[N];
struct A {
  big x, y;
} b[N];
int getcost(big x) {
  return lower_bound(a + 1, a + 1 + n, x + k) -
         upper_bound(a + 1, a + 1 + n, x);
}
int getans(big x) { return getcost(x) + getcost(x + m / 2); }
bool in_range(big t, big x) { return t < x && x < t + k; }
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> h >> m >> k;
  vector<big> slx;
  for (int i = 1; i <= n; ++i) {
    int x;
    cin >> x >> a[i];
    b[i].x = x;
    b[i].y = a[i];
    for (auto tmp : {a[i], a[i] - k, a[i] + k}) {
      for (auto tt : {tmp - m / 2, tmp, tmp + m / 2}) {
        if (tt >= 0 && tt < m / 2) {
          slx.push_back(tt);
        }
      }
    }
  }
  slx.push_back(0);
  sort(a + 1, a + 1 + n);
  sort(slx.begin(), slx.end());
  slx.erase(unique(slx.begin(), slx.end()), slx.end());
  for (int i = 1; i <= n; ++i) {
    a[i + n] = a[i] + m;
  }
  n *= 2;
  big ans = getans(0), anst = 0;
  for (auto x : slx) {
    int w = getans(x);
    if (ans > w) {
      ans = w;
      anst = x;
    }
  }
  vector<int> cancel;
  for (int i = 1; i <= n / 2; ++i) {
    if (in_range(anst, b[i].y) || in_range(anst + m / 2, b[i].y) ||
        in_range(anst + m / 2, b[i].y + m)) {
      cancel.push_back(i);
    }
  }
  anst += k;
  if (anst >= m / 2) {
    anst -= m / 2;
  }
  cout << ans << " " << anst << "\n";
  assert(cancel.size() == ans);
  for (int x : cancel) {
    cout << x << " ";
  }
  cout << "\n";
  return 0;
}
