#include <bits/stdc++.h>
using namespace std;
int main() {
  int clients, maxByte;
  cin >> clients >> maxByte;
  int lowByte, highByte;
  cin >> lowByte >> highByte;
  vector<pair<int, int> > clientByte;
  for (int i = 0; i < clients; i++) {
    int lowPic, highPic;
    cin >> lowPic >> highPic;
    int byteUsage = lowPic * lowByte + highPic * highByte;
    int index = i + 1;
    clientByte.push_back(make_pair(byteUsage, index));
  }
  sort(clientByte.begin(), clientByte.end());
  long long int currentByte = 0;
  vector<int> choosen;
  int index = 0;
  while (currentByte < maxByte) {
    currentByte += clientByte.at(index).first;
    if (currentByte > maxByte) break;
    choosen.push_back(clientByte.at(index).second);
    index++;
    if (index == clients) break;
  }
  cout << choosen.size() << endl;
  for (int i = 0; i < choosen.size(); i++) cout << choosen.at(i) << " ";
  return 0;
}
