#include <stdio.h>
#include <stdint.h>
uint8_t reverse_bits(uint8_t val) {
uint8_t result= 0;
// Your logic here
for (int i=0; i<8; i++){
uint8_t bit = val & 1;
result <<= 1; // Started with all 0, we need to shift to make space.
result |= bit; // take the new value
val >>= 1;
}
return result;
}
int main() {
uint8_t val;
scanf("%hhu", &val);
uint8_t result = reverse_bits(val);
printf("%u", result);
return 0;
}