#include <stdio.h>
#include <stdint.h>
uint32_t rotate_right(uint32_t reg, uint8_t n) {
// set the modulus op to optimize rotations for 32 iterations
const uint8_t reg_size = sizeof(reg) * 8; // 8 bits per byte
n %= reg_size;
// right shift, left shift and OR to get final val
reg = (reg >> n) | (reg << (reg_size - n));
return reg;
}
int main() {
uint32_t reg;
uint8_t n;
scanf("%u %hhu", ®, &n);
printf("%u", rotate_right(reg, n));
return 0;
}