#include <stdio.h>

void comb(int a, int b, int *c) {
    *c = (a % 10) * 1000 + (b / 10) * 1 + (a / 10) * 10 + b % 10*100;
}

int main() {
    int a, b, result;
    scanf("%d %d", &a, &b);

    comb(a, b, &result);

    printf("%d\n", result);

    return 0;
}
