#include <iostream>
#include <string>
#include <bitset>
using namespace std;
int main()
{
unsigned int v,a,b;
while (cin>>v>>a>>b)
{
bitset<32> bitv{ v };
string str = bitv.to_string();
if (b == 0)
str[31 - a] = '0';
if (b == 1)
str[31 - a] = '1';
cout << str << endl;
}
return 0;
}