#include <bits/stdc++.h>
using namespace std;
vector<pair<int, pair<int, int> > > all;
map<int, int> in;
map<int, int> out;
set<int> have;
bool F(pair<int, pair<int, int> > a, pair<int, pair<int, int> > b) {
  return a.second < b.second;
}
int main() {
  int N, M, H, K, l, r, big = 2e9, where, i, j, x, y, t = 0;
  scanf("%d %d %d %d", &N, &H, &M, &K);
  if (K == 1) {
    printf("0 0\n");
    return 0;
  }
  for (i = 0; i < N; i++) {
    scanf("%d %d", &x, &y);
    l = y + 1;
    r = y + K - 1;
    l %= M;
    r %= M;
    if (l > r) {
      all.push_back(make_pair(i, make_pair(l, M - 1)));
      all.push_back(make_pair(i, make_pair(0, r)));
    } else
      all.push_back(make_pair(i, make_pair(l, r)));
    l += M / 2;
    r += M / 2;
    l %= M;
    r %= M;
    if (l > r) {
      all.push_back(make_pair(i, make_pair(l, M - 1)));
      all.push_back(make_pair(i, make_pair(0, r)));
    } else
      all.push_back(make_pair(i, make_pair(l, r)));
  }
  for (auto i : all) {
    have.insert(i.second.first);
    have.insert(i.second.second);
    have.insert((i.second.second + 1) % M);
    in[i.second.first]++;
    out[i.second.second]++;
  }
  if (*have.begin() != 0) {
    big = 0;
    where = 0;
  } else {
    t = 0;
    for (auto i : have) {
      t += in[i];
      if (t < big) {
        big = t;
        where = i;
      }
      t -= out[i];
    }
  }
  printf("%d %d\n", big, where);
  for (auto i : all) {
    if (i.second.first <= where && i.second.second >= where)
      printf("%d ", i.first + 1);
  }
  return 0;
}
