#include <stdio.h>
#include <stdint.h>
uint32_t rotate_right(uint32_t reg, uint8_t n) {
// Your code here
uint32_t temp_reg = reg;
for(uint8_t i=0; i<n; i++){
if(0b01 & temp_reg){
//printf("0b01: %d\n", temp_reg);
temp_reg = (temp_reg>>1) | 0x80000000;
}else{
//printf("0b00: %d\n", temp_reg);
temp_reg = temp_reg>>1;
}
}
return temp_reg;
}
int main() {
uint32_t reg;
uint8_t n;
scanf("%u %hhu", ®, &n);
printf("%u", rotate_right(reg, n));
return 0;
}