#include <stdio.h>
unsigned char modifyBit(unsigned char reg, int pos, int mode) {
// Write your code here
//1. Check if we want to set/clear bit
//1.1 If mode = true(1) we want to set a bit
if(mode){
reg |= (1<<pos); //Shift 0001 into the correct position & OR to set
}
else{
reg &= ~(1<<pos);
}
return reg;
}
int main() {
unsigned char reg;
int pos, mode;
scanf("%hhu %d %d", ®, &pos, &mode);
printf("%d", modifyBit(reg, pos, mode));
return 0;
}