#include <bits/stdc++.h>
using namespace std;
class SegmentTree {
  vector<long long> sum;
  vector<int> lc;
  vector<int> rc;
  int Pool;

 public:
  SegmentTree(int N) : sum(N * 60), lc(N * 60), rc(N * 60) { Pool = 0; }
  void update(int l, int r, int &x, int p, int v) {
    if (x == 0) {
      x = ++Pool;
    }
    sum[x] += v;
    if (l == r) {
      return;
    }
    int mid = (l + r) / 2;
    if (p <= mid) {
      update(l, mid, lc[x], p, v);
    } else {
      update(mid + 1, r, rc[x], p, v);
    }
  }
  int query(int l, int r, int x, int a, int b) {
    if (l > b || r < a || x == 0) {
      return 0;
    }
    if (l >= a && r <= b) {
      return sum[x];
    }
    int mid = l + r >> 1;
    return query(l, mid, lc[x], a, b) + query(mid + 1, r, rc[x], a, b);
  }
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  long long h, m, k;
  cin >> n >> h >> m >> k;
  long long o = m / 2;
  SegmentTree seg(n);
  int root = 0;
  vector<pair<long long, long long> > a;
  for (int i = 0; i < n; ++i) {
    long long x, y;
    cin >> x >> y;
    long long z = x * m + y;
    a.emplace_back(x, y);
    seg.update(0, o, root, z % o, 1);
  }
  if (k == 1) {
    cout << 0 << ' ' << 0 << '\n';
    cout << '\n';
    exit(0);
  }
  int mn = n + 1;
  int L = -1;
  int R = -1;
  int start;
  for (int i = 0; i < n; ++i) {
    int r = ((a[i].second - 1) % o + o) % o;
    int l = ((a[i].second % o - k + 1) % o + o) % o;
    int cur;
    if (l <= r) {
      cur = seg.query(0, o, root, l, r);
    } else {
      cur = seg.query(0, o, root, l, o) + seg.query(0, o, root, 0, r);
    }
    if (cur < mn) {
      mn = cur;
      L = l;
      R = r;
      start = a[i].second % o;
    }
  }
  vector<int> ans;
  for (int i = 0; i < n; ++i) {
    int p = a[i].second % o;
    if (L <= R) {
      if (L <= p && p <= R) {
        ans.emplace_back(i);
      }
    } else {
      if (p <= R || p >= L) {
        ans.emplace_back(i);
      }
    }
  }
  cout << mn << ' ' << start << '\n';
  for (int i : ans) {
    cout << i + 1 << ' ';
  }
  cout << '\n';
  return 0;
}
