#include <stdio.h>

int main() {
    int P, n1, n2;
    scanf("%d", &P);
    scanf("%d", &n1);
    scanf("%d", &n2);
    if(P == 0){
        if((n1+n2) % 2 == 0){
            printf("0");
        }
        else{
            printf("1");
        }
    }
    else{
        if((n1+n2) % 2 == 0){
            printf("1");
        }
        else{
            printf("0");
        }
    }

    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: