#include <stdio.h>
#include <stdint.h>
uint8_t reverse_bits(uint8_t val) {
// Your logic here
uint8_t output = 0;
for(int i=0;i<8;i++){
output <<=1; //Shift output reg << so LSB's go to end/left(reversed)
output |= (val & 1); //Add current LSB of val to output
val >>=1; //Shift val to right to get next bit
}
return output;
}
int main() {
uint8_t val;
scanf("%hhu", &val);
uint8_t result = reverse_bits(val);
printf("%u", result);
return 0;
}