#include <bits/stdc++.h>
using namespace std;
int main() {
  pair<int, int> a[100002];
  int n, m, i, j, k, p, h1, h2, pas[100002];
  cin >> n >> m;
  cin >> h1 >> h2;
  for (i = 0; i < n; i++) {
    cin >> p >> k;
    a[i].first = p * h1 + k * h2;
    a[i].second = i;
  }
  sort(a, a + n);
  k = 0;
  for (i = 0; i < n; i++) {
    if (m >= a[i].first) {
      m = m - a[i].first;
      pas[k] = a[i].second;
      k++;
    } else {
      break;
    }
  }
  cout << k << endl;
  for (i = 0; i < k; i++) cout << pas[i] + 1 << " ";
}
