#include <stdio.h>
#include <stdint.h>
#define START_offset (0)
#define COMMAND_offset (1)
#define VALUE_offset (2)
#define STATUS_offset (4)
#define CHECKSUM_offset (5)
#define END_offset (9)
void build_packet(uint8_t command, uint16_t value, uint8_t status, uint32_t checksum) {
uint8_t buffer[10];
// Your logic to fill buffer
// Then print buffer
*(buffer + START_offset) = 0xA5;
*(buffer + COMMAND_offset) = command;
*(uint16_t*)(buffer + VALUE_offset) = value;
*(buffer + STATUS_offset) = status;
*(uint32_t*)(buffer + CHECKSUM_offset) = checksum;
*(buffer + END_offset) = 0x5A;
for(uint8_t i = 0; i < 10; i++){
printf("%d ", buffer[i]);
}
}
int main() {
uint8_t cmd, status;
uint16_t val;
uint32_t crc;
scanf("%hhu %hu %hhu %u", &cmd, &val, &status, &crc);
build_packet(cmd, val, status, crc);
return 0;
}