#include
#include
#include
#include
using namespace std;
class int128;
void shift(int128 & in,deque & de);
template
bool operator<(bitset const& b1,bitset const& b2)
{
int i=N;
while( i-- && b1[i]==b2[i] ) { }
return ((-1 == i) ? false : (b1[i]
}
class int128
{
bitset<128> number;
public:
explicit int128(string str):number(str){}
int128(bitset<128>const& b):number(b){}
int128(int a = 0 , int b = 0 , int c = 0 , int d = 0)
{
bitset<32> b1(a),b2(b),b3(c),b4(d);
int i, k = 128;
for(i = 32 ; i ; number[--k] = b1[--i]) { }
for(i = 32 ; i ; number[--k] = b2[--i]) { }
for(i = 32 ; i ; number[--k] = b3[--i]) { }
for(i = 32 ; i ; number[--k] = b4[--i]) { }
}
bool operator[](size_t i)const