#include <stdio.h>
#include <stdint.h>
uint32_t rotate_right(uint32_t reg, uint8_t n) {
// Your code here
for(int i=0; i < n; i++){
// get the rightmost bit
uint32_t right_bit = reg & 1;
// shift right
reg >>= 1;
// place the rightmost bit at the left most bit
reg |= (right_bit << 31);
}
return reg;
}
int main() {
uint32_t reg;
uint8_t n;
scanf("%u %hhu", ®, &n);
printf("%u", rotate_right(reg, n));
return 0;
}