#include <bits/stdc++.h>
using namespace std;
const int M = 1e5 + 7;
struct node {
  int h, m, id;
  bool operator<(const node& r) const { return m < r.m; }
} p[M];
int a[M];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, h, m, k;
  cin >> n >> h >> m >> k;
  for (int i = 1; i <= n; i++) cin >> p[i].h >> p[i].m, p[i].id = i;
  sort(p + 1, p + 1 + n);
  int mi = n + 1, ans = 0;
  for (int i = 1; i <= n; i++) a[i] = p[i].m;
  int tp, id, nm, l;
  for (int i = 1; i <= n; i++) {
    tp = p[i].m;
    {
      nm = 0;
      tp %= m / 2;
      id = upper_bound(a + 1, a + 1 + n, tp - k) - a;
      int r = lower_bound(a + 1, a + 1 + n, tp) - a;
      nm += max(0, r - id);
      if (tp < k) {
        id = upper_bound(a + 1, a + 1 + n, m - (k - tp)) - a;
        nm += max(0, n + 1 - id);
      }
      l = upper_bound(a + 1, a + 1 + n, tp + m / 2 - k) - a;
      id = lower_bound(a + 1, a + 1 + n, tp + m / 2) - a;
      nm += max(0, id - l);
      if (tp + m / 2 > m) {
        id = lower_bound(a + 1, a + 1 + n, tp + m / 2 - m) - a;
        nm += max(id - 1, 0);
      }
    }
    if (nm < mi) mi = nm, ans = tp;
    tp = (p[i].m + k) % m;
    {
      nm = 0;
      tp %= m / 2;
      id = upper_bound(a + 1, a + 1 + n, tp - k) - a;
      int r = lower_bound(a + 1, a + 1 + n, tp) - a;
      nm += max(0, r - id);
      if (tp < k) {
        id = upper_bound(a + 1, a + 1 + n, m - (k - tp)) - a;
        nm += max(0, n + 1 - id);
      }
      l = upper_bound(a + 1, a + 1 + n, tp + m / 2 - k) - a;
      id = lower_bound(a + 1, a + 1 + n, tp + m / 2) - a;
      nm += max(0, id - l);
      if (tp + m / 2 > m) {
        id = lower_bound(a + 1, a + 1 + n, tp + m / 2 - m) - a;
        nm += max(id - 1, 0);
      }
    }
    if (nm < mi) nm = mi, ans = tp;
  }
  cout << mi << " " << ans << endl;
  vector<int> v;
  int t = ans;
  for (int i = 1; i <= n; i++) {
    int z = a[i], id = p[i].id;
    bool f = false;
    if (z < t && z > t - k) f = true;
    if (z > t - k + m) f = true;
    if (z > t + m / 2 - k && z < t + m / 2) f = true;
    if (z < t + m / 2 - m) f = true;
    if (f) v.push_back(id);
  }
  sort(v.begin(), v.end());
  for (auto x : v) cout << x << " ";
  cout << endl;
  return 0;
}
