#include <stdio.h>
#include <stdint.h>
uint32_t rotate_right(uint32_t reg, uint8_t n)
{
uint32_t mask=reg&((1<<n)-1); //we need to extract the data corresponding to the bits on LSB.
return (reg>>n)|(mask<<(32-n)); //perform right shift and OR with shifted mask.
}
int main() {
uint32_t reg;
uint8_t n;
scanf("%u %hhu", ®, &n);
printf("%u", rotate_right(reg, n));
return 0;
}