#include <stdio.h>
#include <stdint.h>
void add_with_carry(uint8_t a, uint8_t b, uint8_t* result, uint8_t* carry)
{
if((a+b)>255) //if the sum of two numbers is greater than 255
{
*result=(a+b)-256;
*carry=1;
}
else
{
*result=a+b;
*carry=0;
}
}
int main() {
uint8_t a, b, result, carry;
scanf("%hhu %hhu", &a, &b);
add_with_carry(a, b, &result, &carry);
printf("%u ", result);
printf("%u", carry);
return 0;
}