#include<iostream>
#include<bitset>
#include<vector>
#include<cstdlib>
#include<complex>
#include<cmath>
const double PI = atan(1.0)*4.0;
int n = 0;
using namespace std;
int power(int pow)
{
int result = 1;
for(int i = 0;i != pow;i++)
result *= 2;
return result;
}
unsigned long rey(unsigned int k,int pow)
{
bitset<32> bit(k);
bitset<32> bitnew(0);
int i = pow,j = 0;
for(;i>=0;i--)
bitnew[j++] = bit[i];
cout<<bitnew<<endl;
unsigned long newk = bitnew.to_ulong();
return newk;
}