#include <stdio.h>
int setorclear(int num,int pos,int con){
int result;
if(con==1){
result=num | (1 << pos);
}
else{
result=num & ~(1<<pos);
}
return result;
}
int main(){
int num;
int pos;
int con;
//printf("enter a number or An 8-bit integer (0-255) ");
scanf("%d",&num);
//printf("enter the bit position to modify that position ");
scanf("%d",&pos);
//printf("enter a 1 for operation set and 0 for clear");
scanf("%d",&con);
printf("%d", setorclear(num,pos,con));
}