**PS: Edited OP and added examples. Please check accordingly.**

@l_returns I understood what you said, but I’m not sure if you are getting the question correct. I’m editing the OP to make the question more clear. Also, I have written down the code snippet based on your answer, but I’m not able to figure out how this will get me the desired result.

Also you mention MSB to be the right most one, but LSB is the right most one. MSB is the left most one.

```
#include<bits/stdc++.h>
using namespace std;
bool isLsbOne(int n)
{
if (n & 1)
return true;
return false;
}
vector<int> retOddArray(vector<int> &a)
{
vector<int> b;
for (int i=0; i<a.size(); i++)
{
if (isLsbOne(i))
b.push_back(a[i] >> 1);
a[i] >>= 1;
}
if (b.size() >= 4)
return b;
return retOddArray(a);
}
int main()
{
int n, input;
cin>>n;
vector<int> v;
for (int i=0; i<n; i++)
{
cin>>input;
v.push_back(input);
}
vector<int> a = retOddArray(v);
sort(a.begin(), a.end(), greater<int>());
int b = a[0] & a[1] & a[2] & a[3];
cout<<b<<endl;
return 0;
}
```