#include <stdio.h>                                                                                                                                                               
#include <stdlib.h>                                                                                                                                                              
#include <string.h>                                                                                                                                                              
                                                                                                                                                                                 
int main (void) {                                                                                                                                                                
    char s[11], t[11];                                                                                                                                                           
    scanf("%s%s", s, t);                                                                                                                                                         
    int a, b;                                                                                                                                                                    
    scanf("%d%d", &a, &b);                                                                                                                                                       
    char u[11];                                                                                                                                                                  
    scanf("%s", u);                                                                                                                                                              
                                                                                                                                                                                 
    if ( !strcmp(s, u) )                                                                                                                                                         
        a--;                                                                                                                                                                     
    else                                                                                                                                                                         
        b--;                                                                                                                                                                     
                                                                                                                                                                                 
    printf("%d %d\n", a, b);                                                                                                                                                     
                                                                                                                                                                                 
    return EXIT_SUCCESS;                                                                                                                                                         
}

Measured memory_bytes: 128