#include <bits/stdc++.h>
using namespace std;
bool DEBUG = 0;
void solve() {
  long long n, h, m, k;
  cin >> n >> h >> m >> k;
  long long x, y;
  vector<long long> a;
  map<long long, vector<long long> > e;
  for (__typeof(n) i = (0) - ((0) > (n)); i != (n) - ((0) > (n));
       i += 1 - 2 * ((0) > (n))) {
    cin >> x >> y;
    y %= (m / 2);
    e[y].push_back(i + 1);
    a.push_back(y);
    if (h != 1) {
      a.push_back((y - (m / 2)));
      a.push_back(((m / 2) + y));
    }
  }
  long long l = k - 1;
  sort((a).begin(), (a).end());
  long long ans = n;
  if (l == 0) {
    cout << "0 0\n\n";
    return;
  }
  for (__typeof((long long)a.size()) i = (0) - ((0) > ((long long)a.size()));
       i != ((long long)a.size()) - ((0) > ((long long)a.size()));
       i += 1 - 2 * ((0) > ((long long)a.size()))) {
    if (a[i] >= (m / 2)) break;
    long long p = lower_bound(a.begin(), a.end(), (a[i] + l)) - a.begin();
    if (p == (long long)a.size()) {
      ans = min(ans, (long long)a.size() - 1 - i);
    } else if (a[p] == a[i] + l) {
      p = upper_bound(a.begin(), a.end(), (a[i] + l)) - a.begin();
      p--;
      ans = min(ans, p - i);
    } else {
      ans = min(ans, p - i - 1);
    }
  }
  cout << ans << " ";
  vector<long long> bb;
  for (__typeof((long long)a.size()) i = (0) - ((0) > ((long long)a.size()));
       i != ((long long)a.size()) - ((0) > ((long long)a.size()));
       i += 1 - 2 * ((0) > ((long long)a.size()))) {
    if (a[i] >= (m / 2)) break;
    long long p = lower_bound(a.begin(), a.end(), (a[i] + l)) - a.begin();
    long long a1 = -1;
    if (p == (long long)a.size()) {
      a1 = (long long)a.size() - 1 - i;
    } else if (a[p] == a[i] + l) {
      p = upper_bound(a.begin(), a.end(), (a[i] + l)) - a.begin();
      p--;
      a1 = p - i;
    } else {
      a1 = p - i - 1;
    }
    if (a1 == ans) {
      long long left = ((a[i] + (m / 2)) % (m / 2)) + 1;
      long long r = left + l - 1;
      left %= (m / 2);
      r %= (m / 2);
      long long l1 = r, l2 = left;
      if (left > r) {
        l1 = (m / 2);
        l2 = 0;
      }
      cout << (r + 1) % (m / 2) << "\n";
      for (auto u : e) {
        if ((u.first >= left && u.first <= l1) ||
            (u.first >= l2 && u.first <= r)) {
          for (auto o : u.second) {
            bb.push_back(o);
          }
        }
      }
      break;
    }
  }
  sort((bb).begin(), (bb).end());
  for (auto u : bb) cout << u << " ";
  cout << "\n";
}
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
}
