#include <iostream>
#include <cstdlib>
using namespace std;
char s[10];
int n;
int main()
{
cin >> n;
itoa(n, s, 2);
int end = 0;
while (s[end] != ' ')
end++;
end--;
if (n >= 0) cout << 0;
else cout << 1;
int mask = 1, num = 0;
for (int i = end; i >= 0 && i >= end - 6; i--)
{
num += (s[i] - '0') * mask;
mask *= 10;
}
printf("%07d", num);
return 0;
}