#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100000;
struct s {
  int ind;
  int x;
};
bool operator<(const s& a, const s& b) { return a.x < b.x; }
bool operator<(int x, const s& a) { return x < a.x; }
s a[MAX_N];
int n, h, m, k;
int f(int x) {
  if (x >= k) {
    int l = upper_bound(a, a + n, x - k) - a;
    int r = upper_bound(a, a + n, x - 1) - 1 - a;
    return r - l + 1;
  }
  int ans1 = upper_bound(a, a + n, x - 1) - a;
  int r = upper_bound(a, a + n, x - k + m) - a;
  return n - r + ans1;
}
bool f0(int x, int i) {
  if (i >= k) {
    return i - k < x && x < i;
  }
  return x < i || i - k + m < x;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> h >> m >> k;
  for (int i = 0; i < n; ++i) {
    cin >> h >> a[i].x;
    a[i].ind = i;
  }
  sort(a, a + n);
  int ans_t;
  int ans = n;
  for (int i = 0; i < n; ++i) {
    int l = f(a[i].x) + f((a[i].x + (m >> 1)) % m);
    if (l < ans) {
      ans = l;
      ans_t = a[i].x;
    }
  }
  cout << ans << ' ' << ans_t % (m >> 1) << '\n';
  for (int i = 0; i < n; ++i) {
    if ((f0(a[i].x, ans_t)) || (f0(a[i].x, (ans_t + (m >> 1)) % m))) {
      cout << a[i].ind + 1 << ' ';
    }
  }
  return 0;
}
