#include <bits/stdc++.h>
using namespace std;
int a, b;
int arr1[26], arr2[26], arr3[26], arr4[26];
map<int, int> m, m1;
int main() {
  int n, d;
  cin >> n >> d;
  cin >> a >> b;
  pair<long long int, int> v[n];
  for (int x = 0; x < n; x++) {
    int p, q;
    cin >> p >> q;
    v[x] = make_pair(a * p + b * q, x + 1);
  }
  int count = 0;
  int sum = 0;
  sort(v, v + n);
  for (int x = 0; x < n; x++) {
    if (sum + v[x].first <= d) {
      count++;
      sum += v[x].first;
    }
  }
  cout << count << endl;
  for (int x = 0; x < count; x++) {
    cout << v[x].second << " ";
  }
}
