#include <bits/stdc++.h>
using namespace std;
vector<int> val(100001);
set<int> s;
map<int, int> m;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, h, m1, k;
  cin >> n >> h >> m1 >> k;
  int z = m1 / 2;
  int x, y;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    val[i] = y % z;
  }
  m[0] = 0;
  s.insert(0);
  for (int i = 0; i < n; i++) {
    int a1 = (val[i] + 1) % z;
    int a2 = (val[i] + k) % z;
    if (a1 < a2) {
      m[a1] += 1;
      m[a2] -= 1;
      s.insert(a1);
      s.insert(a2);
    } else {
      s.insert(a1);
      s.insert(a2);
      m[0] += 1;
      m[a1] += 1;
      m[a2] -= 1;
    }
  }
  int cur = 0;
  int idx = -1;
  int mn = n + 1;
  for (set<int>::iterator it = s.begin(); it != s.end(); it++) {
    int pos = *it;
    cur += m[pos];
    if (cur < mn) {
      mn = cur;
      idx = pos;
    }
  }
  vector<int> cancel;
  for (int i = 0; i < n; i++) {
    int a1 = (val[i] + 1) % z;
    int a2 = (val[i] + k) % z;
    if (a1 < a2 && idx >= a1 && idx < a2) {
      cancel.push_back(i);
    } else if (a1 > a2 && (idx >= a1 || idx < a2)) {
      cancel.push_back(i);
    }
  }
  cout << cancel.size() << " " << idx << endl;
  for (int i = 0; i < cancel.size(); i++) cout << cancel[i] + 1 << " ";
  cout << endl;
}
