#include <stdio.h>
int main() {
unsigned char reg;
int pos, mode;
// Read inputs
scanf("%hhu", ®);
scanf("%d", &pos);
scanf("%d", &mode);
if (mode == 1) {
// Set the bit
reg = reg | (1 << pos);
} else if (mode == 0) {
// Clear the bit
reg = reg & ~(1 << pos);
}
// Print modified register value
printf("%d\n", reg);
return 0;
}