#include <bits/stdc++.h>
using namespace std;
unsigned int n;
inline unsigned int subsqcnt(unsigned int asd) {
unsigned int ff;
if(asd==0)
return 1;
else if(asd==1)
return 2;
else
return subsqcnt(asd-2) + subsqcnt(asd-1) + 1;
}
inline int uniqsubBIT(bitset<32> bs, int length) {
bs = bs.flip();
int yk = 1;
int nl = 0;
int count = 2;
int prev;
for(int i=length-2; i>=0; i--) {
iiiiii++;
prev = count;
count *= 2;
if(bs[i]==false) {
count -= nl;
nl = prev;
} else {
count -= yk;
yk = prev;
}
}
return count;
}
int main() {
cin >> n;
int bp = 1;
for(int i=0; i<n; i++) {
bp = i;
if(subsqcnt(i)-1>=n)
break;
}
string cur;
einain:
int ff = pow(2, bp)/1.5;
for(int i=pow(2, bp)/10; i<ff; i++) {
if(__builtin_popcount(i)==1&&i>2){
herranpieksut:
int fhj = i;
int huhu=1;
while(fhj>=2) {
fhj/=2;
huhu++;
}
int verytemp =(4*pow(2,huhu)-3-(-pow(-1,huhu)))/6+1;
bitset<32> bst(verytemp);
if(uniqsubBIT(bst, bp)-1<n) {
i = pow(2, huhu);
continue;
}
}
bitset<32> bs(i);
int nnnnnn = uniqsubBIT(bs, bp);
POISTAMUTHETINYT++;
if(nnnnnn-1 == n) {
cout << bs.to_string().substr(32-bp);
return 0;
}
if(nnnnnn*2<n) { /// ei kai toimi
i++;
if(__builtin_popcount(i)==1&&i>2)
goto herranpieksut;
}
}
bp++;
goto einain;
}