#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
ll mod = 998244353;
ll gcd(ll a, ll b) {
  if (a == 0 or b == 0) return a + b;
  return gcd(b, a % b);
}
ll sum(ll a, ll b) {
  a += b;
  a %= mod;
  return a;
}
ll sub(ll a, ll b) {
  a += mod - b;
  a %= mod;
  return a;
}
ll mul(ll a, ll b) { return a * b % mod; }
ll pew(ll a, ll b) {
  ll res = 1;
  while (b) {
    if (b & 1) res = mul(res, a);
    a = mul(a, a);
    b /= 2;
  }
  return res;
}
int parent[100001];
int rnk[100001];
void make_set(int v) {
  parent[v] = v;
  rnk[v] = 0;
}
int find_set(int v) {
  if (v == parent[v]) return v;
  return parent[v] = find_set(parent[v]);
}
void union_sets(int a, int b) {
  a = find_set(a);
  b = find_set(b);
  if (a != b) {
    if (rnk[a] < rnk[b]) swap(a, b);
    parent[b] = a;
    if (rnk[a] == rnk[b]) ++rnk[a];
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  ll n, h, m, k;
  cin >> n >> h >> m >> k;
  vector<ll> kek(n);
  m /= 2;
  vector<pair<ll, ll>> ord;
  ll cur = 0;
  for (int i = 0; i < n; i++) {
    cin >> kek[i];
    cin >> kek[i];
    kek[i] %= m;
    ord.push_back({kek[i], 1});
    if (kek[i] + k >= m) cur++;
    ord.push_back({(kek[i] + k) % m, -1});
  }
  sort(ord.begin(), ord.end());
  ll bst = cur;
  ll t = 0;
  for (int i = 0; i < ord.size(); i++) {
    if (ord[i].second == 1) {
      cur++;
    } else {
      cur--;
      if (cur < bst) {
        bst = cur;
        t = ord[i].first;
      }
    }
  }
  cout << bst << " " << t << endl;
  for (int i = 0; i < n; i++) {
    if ((kek[i] < t and kek[i] > t - k) or
        (kek[i] < t + m and kek[i] > t + m - k))
      cout << i + 1 << " ";
  }
}
