#include <bits/stdc++.h>
using namespace std;
long long int advceil(long long int num, long long int den) {
  return (num % den == 0 ? num / den : num / den + 1);
}
long long int lstbt(long long int val) {
  long long int msk = val & (val - 1);
  return log2(val ^ msk);
}
long long int n, h, m, k, x;
vector<long long int> b;
vector<long long int> qry;
long long int calci(long long int a, long long int b) {
  if (b < a) return 0;
  auto itr1 = upper_bound(qry.begin(), qry.end(), b);
  auto itr2 = lower_bound(qry.begin(), qry.end(), a);
  return itr1 - itr2;
}
long long int check(long long int &init) {
  if ((init + k) % m >= m / 2) init = (init + m / 2) % m;
  long long int a1, b1, a2, b2, curr = 0, x1 = 0, y1 = 0;
  a2 = init;
  a1 = (init + k) % m;
  b1 = a1 + m / 2;
  b2 = (b1 - k);
  if (a2 > a1)
    x1 = calci(a2 + 1, m) + calci(-1, a1 - 1);
  else
    x1 = calci(a2 + 1, a1 - 1);
  y1 = calci(b2 + 1, b1 - 1);
  curr = x1 + y1;
  return curr;
}
void method1() {
  long long int init = 0;
  long long int ptr = -1;
  long long int ans = n;
  long long int t = 0;
  while (ptr <= n) {
    long long int curr = check(init);
    if (ans > curr) {
      ans = curr;
      t = (init + k) % (m / 2);
    }
    ptr++;
    init = qry[ptr];
  }
  cout << ans << " " << t << endl;
  long long int a1, a2, b1, b2;
  init = t;
  a1 = init;
  a2 = ((init - k) % m + m) % m;
  b1 = init + m / 2;
  b2 = (b1 - k);
  if (ans != 0) {
    for (long long int i = 0; i < n; i++) {
      if (a2 > a1 &&
          ((a2 + 1 <= b[i] && b[i] <= m) || (-1 <= b[i] && b[i] <= a1 - 1)))
        cout << i + 1 << " ";
      else if (a2 + 1 <= b[i] && b[i] <= a1 - 1)
        cout << i + 1 << " ";
      if (b2 + 1 <= b[i] && b[i] <= b1 - 1) cout << i + 1 << " ";
    }
    cout << endl;
  }
}
void solve() {
  cin >> n >> h >> m >> k;
  b.resize(n);
  for (long long int i = 0; i < n; i++) cin >> x >> b[i];
  for (long long int i = 0; i < b.size(); i++) qry.push_back(b[i]);
  sort(qry.begin(), qry.end());
  method1();
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
}
