#include <stdio.h>
#include <stdint.h>
uint32_t set_bits(uint32_t reg, uint8_t pos, uint8_t len) {
// Your code here
// 1. Set all bit uptil the max required, then clear the bits from LSB to ith pos
// uint32_t mask = ((uint32_t)(1<<(pos+len))-1) & ~((uint32_t)(1<<pos)-1);
// 2. Create #1s based on the len given and then shift appropriately
uint32_t mask = ((1U << len) - 1U) << pos;
reg |= mask;
return reg;
}
int main() {
uint32_t reg;
uint8_t pos, len;
scanf("%u %hhu %hhu", ®, &pos, &len);
printf("%u", set_bits(reg, pos, len));
return 0;
}