#include <bits/stdc++.h>
using namespace std;
template <class T>
ostream &operator<<(ostream &os, vector<T> V) {
  os << "[ ";
  for (auto v : V) os << v << " ";
  os << "]";
  return os;
}
template <class T>
ostream &operator<<(ostream &os, set<T> S) {
  os << "{ ";
  for (auto s : S) os << s << " ";
  return os << "}";
}
template <class L, class R>
ostream &operator<<(ostream &os, map<L, R> M) {
  os << "{ ";
  for (auto m : M) os << "(" << m.first << ":" << m.second << ") ";
  return os << "}";
}
template <class L, class R>
ostream &operator<<(ostream &os, pair<L, R> P) {
  return os << "(" << P.first << "," << P.second << ")";
}
const long long N = 600005;
long long a[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, h, m, k;
  cin >> n >> h >> m >> k;
  vector<pair<long long, long long>> p;
  for (long long i = 0; i < n; i++) {
    long long a, b;
    cin >> a >> b;
    p.push_back({i, a * m + b});
  }
  vector<pair<long long, long long>> intervals;
  for (long long i = 0; i < n; i++) {
    long long k1 = 2 * p[i].second / m;
    k1 = p[i].second - k1 * m / 2;
    intervals.push_back({k1 + 1, k1 + k});
    k1 -= m / 2;
    intervals.push_back({k1 + 1, k1 + k});
  }
  map<long long, long long> m1;
  for (long long i = 0; i < intervals.size(); i++)
    m1[intervals[i].first]++, m1[intervals[i].second]++;
  long long c = 1;
  map<long long, long long> rev;
  for (auto it : m1) m1[it.first] = c++, rev[c - 1] = it.first;
  for (long long i = 0; i < intervals.size(); i++)
    a[m1[intervals[i].first]]++, a[m1[intervals[i].second]]--;
  for (long long i = 1; i < c; i++) a[i] += a[i - 1];
  long long mn = 1e18, ans = -1;
  for (long long i = 1; i < c - 1; i++) {
    if (a[i] < mn && rev[i] >= 0 && rev[i] <= m / 2) {
      mn = a[i];
      ans = rev[i];
    }
  }
  long long k1 = 2 * ans / m;
  ans = ans - k1 * m / 2;
  vector<long long> missed;
  for (long long i = 0; i < n; i++) {
    long long k1 = 2 * p[i].second / m;
    k1 = p[i].second - k1 * m / 2;
    long long l = k1 + 1, r = k1 + k;
    if (l <= ans && r > ans)
      missed.push_back(i + 1);
    else {
      k1 -= m / 2;
      l = k1 + 1, r = k1 + k;
      if (l <= ans && r > ans) missed.push_back(i + 1);
    }
  }
  cout << missed.size() << ' ' << ans << '\n';
  for (long long i = 0; i < missed.size(); i++) cout << missed[i] << ' ';
  return 0;
}
