#include <bits/stdc++.h>
using namespace std;
int n, A, B;
int const N = 1e5 + 5;
int a[N];
vector <int> kq;
int main()
{
// freopen("me","r",stdin);
// freopen("cung","w",stdout);
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin >> n >> A >> B;
for(int i = 1 ; i <= n ; i++)
cin >> a[i];
for(int i = 1 ; i <= n ; i++)
if(((A | a[i]) != A) && ((a[i] & B) == a[i]))
{
A = A | a[i] ;
kq.push_back(i);
}
if(A != B)
{
cout << -1;
exit(0);
}
cout << kq.size() << '\n';
for(int v : kq) cout << v << ' ';
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG4sIEEsIEI7CmludCBjb25zdCBOID0gMWU1ICsgNTsKaW50IGFbTl07CnZlY3RvciA8aW50PiBrcTsKCmludCBtYWluKCkKewovLyAgICBmcmVvcGVuKCJtZSIsInIiLHN0ZGluKTsKLy8gICAgZnJlb3BlbigiY3VuZyIsInciLHN0ZG91dCk7CiAgICBpb3NfYmFzZTo6c3luY193aXRoX3N0ZGlvKGZhbHNlKTsKICAgIGNpbi50aWUoMCk7CiAgICBjb3V0LnRpZSgwKTsKCiAgICBjaW4gPj4gbiA+PiBBID4+IEI7CiAgICBmb3IoaW50IGkgPSAxIDsgaSA8PSBuIDsgaSsrKQogICAgICAgIGNpbiA+PiBhW2ldOwoKICAgIGZvcihpbnQgaSA9IDEgOyBpIDw9IG4gOyBpKyspCiAgICAgICAgaWYoKChBIHwgYVtpXSkgIT0gQSkgJiYgKChhW2ldICYgQikgPT0gYVtpXSkpCiAgICAgICAgewogICAgICAgICAgICBBID0gQSB8IGFbaV0gOwogICAgICAgICAgICBrcS5wdXNoX2JhY2soaSk7CiAgICAgICAgfQoKICAgIGlmKEEgIT0gQikKICAgIHsKICAgICAgICBjb3V0IDw8IC0xOwogICAgICAgIGV4aXQoMCk7CiAgICB9CgogICAgY291dCA8PCBrcS5zaXplKCkgPDwgJ1xuJzsKCiAgICBmb3IoaW50IHYgOiBrcSkgY291dCA8PCB2IDw8ICcgJzsKCn0=