stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<iostream>

#include<string>

using namespace std;

int main ()

{

    string s;

    string t;

    int a,b;

    string u;

    cin>>s>>t;

    cin>>a>>b;

    cin>>u;

    if(u==s)

        cout<<a-1<<" "<<b<<endl;

    else if (u==t)

        cout<<a<<" "<<b-1<<endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.256755589695221x):
#include <stdio.h>

#include<string.h>





int main ()

{

int A,B,index;

char S[11],T[11],U[11];



scanf("%s %s", &S, &T);

scanf("%d %d", &A, &B);

scanf("%s", &U);





if (strcmp(U,S)==0){

	A--;

	printf("%d %d", A, B);



}

else if(strcmp(U,T)==0){

B--;

printf("%d %d", A, B);



}





	return 0;

	}
// Slower C++ solution:
#include <iostream>

#include <string>

#include <cstring>

#include <algorithm>





using namespace std;



int main()

{

    string s,t,ch;

    int a,b;

    cin>>s>>t;

    cin>>a>>b;

    cin>>ch;

    if(ch==s)

        a--;

    else if(ch==t)

        b--;

    cout<<a<<" "<<b;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.253798684309342x):
#include<stdio.h>

int main()

{

  int A,B;

  char S[10],T[10],U[10];

  scanf("%s %s\n%d %d\n%s",S,T,&A,&B,U);



  if(*S==*U)

  {

    printf("%d %d\n", A-1, B);

  }

  else if(*T==*U)

  {

    printf("%d %d\n", A,B-1);

  }

  return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int main() {

    string S,T,U;

    int A,B;

    cin >>S>>T;

    cin>>A>>B;

    cin>>U;

    if (S==U){

        A-=1;

    } else if (T==U){

        B-=1;

    }

    cout<<A<<" "<<B;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.253798684309342x):
#include<stdio.h>

int main()

{

  int A,B;

  char S[10],T[10],U[10];

  scanf("%s %s\n%d %d\n%s",S,T,&A,&B,U);



  if(*S==*U)

  {

    printf("%d %d\n", A-1, B);

  }

  else if(*T==*U)

  {

    printf("%d %d\n", A,B-1);

  }

  return 0;

}
// Slower C++ solution:
#include<iostream>

#include<cmath>

#include<string>

using namespace std;

int main(){

string x,s,e; cin>>x>>s;

int a,b; cin>>a>>b;

cin>>e;

if(x == e){

    a-=1;

}

else{

    b-=1;

}

cout<<a<<" "<<b;

}


// Faster C++ solution for the same problem (measured speedup: 5.25366606434629x):
#include<stdio.h>

int main()

{

  int A,B;

  char S[10],T[10],U[10];

  scanf("%s %s\n%d %d\n%s",S,T,&A,&B,U);



  if(*S==*U)

  {

    printf("%d %d\n", A-1, B);

  }

  else if(*T==*U)

  {

    printf("%d %d\n", A,B-1);

  }

  return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int main(){

    string s,t,u;

    int a,b;

    cin>>s;

    cin >>t;

    cin>>a;

    cin>>b;

    cin>>u;

    if (u==s){

        a--;

        cout<<a<<' '<<b;

    } else if (u==t){

        b--;

        cout<<a<<' '<<b;

    }



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.210712614942601x):
#include<stdio.h>

int main()

{

  int A,B;

  char S[10],T[10],U[10];

  scanf("%s %s\n%d %d\n%s",S,T,&A,&B,U);



  if(*S==*U)

  {

    printf("%d %d\n", A-1, B);

  }

  else if(*T==*U)

  {

    printf("%d %d\n", A,B-1);

  }

  return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int main()

{

    string s,t,u;

    int a,b;

    cin >> s >> t;

    cin >> a >> b;

    cin >> u;



    if(u == s){

        a--;

    }

    else if(u == t){

        b--;

    }



    cout << a << " " << b;

    return 0

    ;

}


// Faster C++ solution for the same problem (measured speedup: 5.253798684309342x):
#include<stdio.h>

int main()

{

  int A,B;

  char S[10],T[10],U[10];

  scanf("%s %s\n%d %d\n%s",S,T,&A,&B,U);



  if(*S==*U)

  {

    printf("%d %d\n", A-1, B);

  }

  else if(*T==*U)

  {

    printf("%d %d\n", A,B-1);

  }

  return 0;

}
// Slower C++ solution:
#include<iostream>

#include<string>

using namespace std;

int main ()

{

    string s;

    string t;

    int a,b;

    string u;

    cin>>s>>t;

    cin>>a>>b;

    cin>>u;

    if(u==s)

        cout<<a-1<<" "<<b<<endl;

    else if (u==t)

        cout<<a<<" "<<b-1<<endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.262010296475998x):
#include<stdio.h>

int main()

{

  int A,B;

  char S[10],T[10],U[10];

  scanf("%s %s\n%d %d\n%s",S,T,&A,&B,U);



  if(*S==*U)

  {

    printf("%d %d\n", A-1, B);

  }

  else if(*T==*U)

  {

    printf("%d %d\n", A,B-1);

  }

  return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define rep(i, n) for(int i = 0; i < n; i++)

using namespace std;

using ll = long long;

using P = pair<int, int>;

 

int main(){

	string s, t, u;

  	int a, b;

  	cin >> s >> t >> a >> b >> u;

  

  	if(u == s) a--;

  	else b--;

  	cout << a << " " << b << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.2607748137618024x):
#include<stdio.h>

int main()

{

  int A,B;

  char S[10],T[10],U[10];

  scanf("%s %s\n%d %d\n%s",S,T,&A,&B,U);



  if(*S==*U)

  {

    printf("%d %d\n", A-1, B);

  }

  else if(*T==*U)

  {

    printf("%d %d\n", A,B-1);

  }

  return 0;

}
// Slower C++ solution:
#include <iostream>

#include <string>

#include <cstring>

#include <algorithm>





using namespace std;



int main()

{

    string s,t,ch;

    int a,b;

    cin>>s>>t;

    cin>>a>>b;

    cin>>ch;

    if(ch==s)

        a--;

    else if(ch==t)

        b--;

    cout<<a<<" "<<b;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.247737262802414x):
#include <stdio.h>

#include <string.h>



int main(){

	int A, B;

	char S[25];

	char T[25];

	char U[25];

	

	scanf("%s %s", S, T);

	scanf("%d %d", &A, &B);

	scanf("%s", U);

	

	if(strcmp(U,S)==0){

		printf("%d %d", A-1, B);

	}else if(strcmp(U,T)==0){

		printf("%d %d", A, B-1);

	}

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int main() {

    string S,T,U;

    int A,B;

    cin >>S>>T;

    cin>>A>>B;

    cin>>U;

    if (S==U){

        A-=1;

    } else if (T==U){

        B-=1;

    }

    cout<<A<<" "<<B;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.247737262802414x):
#include <stdio.h>

#include <string.h>



int main(){

	int A, B;

	char S[25];

	char T[25];

	char U[25];

	

	scanf("%s %s", S, T);

	scanf("%d %d", &A, &B);

	scanf("%s", U);

	

	if(strcmp(U,S)==0){

		printf("%d %d", A-1, B);

	}else if(strcmp(U,T)==0){

		printf("%d %d", A, B-1);

	}

	return 0;

}
// Slower C++ solution:
#include<iostream>

#include<cmath>

#include<string>

using namespace std;

int main(){

string x,s,e; cin>>x>>s;

int a,b; cin>>a>>b;

cin>>e;

if(x == e){

    a-=1;

}

else{

    b-=1;

}

cout<<a<<" "<<b;

}


// Faster C++ solution for the same problem (measured speedup: 5.2476047958458905x):
#include <stdio.h>

#include <string.h>



int main(){

	int A, B;

	char S[25];

	char T[25];

	char U[25];

	

	scanf("%s %s", S, T);

	scanf("%d %d", &A, &B);

	scanf("%s", U);

	

	if(strcmp(U,S)==0){

		printf("%d %d", A-1, B);

	}else if(strcmp(U,T)==0){

		printf("%d %d", A, B-1);

	}

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int main(){

    string s,t,u;

    int a,b;

    cin>>s;

    cin >>t;

    cin>>a;

    cin>>b;

    cin>>u;

    if (u==s){

        a--;

        cout<<a<<' '<<b;

    } else if (u==t){

        b--;

        cout<<a<<' '<<b;

    }



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.20470090276852x):
#include <stdio.h>

#include <string.h>



int main(){

	int A, B;

	char S[25];

	char T[25];

	char U[25];

	

	scanf("%s %s", S, T);

	scanf("%d %d", &A, &B);

	scanf("%s", U);

	

	if(strcmp(U,S)==0){

		printf("%d %d", A-1, B);

	}else if(strcmp(U,T)==0){

		printf("%d %d", A, B-1);

	}

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int main()

{

    string s,t,u;

    int a,b;

    cin >> s >> t;

    cin >> a >> b;

    cin >> u;



    if(u == s){

        a--;

    }

    else if(u == t){

        b--;

    }



    cout << a << " " << b;

    return 0

    ;

}


// Faster C++ solution for the same problem (measured speedup: 5.247737262802414x):
#include <stdio.h>

#include <string.h>



int main(){

	int A, B;

	char S[25];

	char T[25];

	char U[25];

	

	scanf("%s %s", S, T);

	scanf("%d %d", &A, &B);

	scanf("%s", U);

	

	if(strcmp(U,S)==0){

		printf("%d %d", A-1, B);

	}else if(strcmp(U,T)==0){

		printf("%d %d", A, B-1);

	}

	return 0;

}
// Slower C++ solution:
#include<iostream>

#include<string>

using namespace std;

int main ()

{

    string s;

    string t;

    int a,b;

    string u;

    cin>>s>>t;

    cin>>a>>b;

    cin>>u;

    if(u==s)

        cout<<a-1<<" "<<b<<endl;

    else if (u==t)

        cout<<a<<" "<<b-1<<endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.255939401053988x):
#include <stdio.h>

#include <string.h>



int main(){

	int A, B;

	char S[25];

	char T[25];

	char U[25];

	

	scanf("%s %s", S, T);

	scanf("%d %d", &A, &B);

	scanf("%s", U);

	

	if(strcmp(U,S)==0){

		printf("%d %d", A-1, B);

	}else if(strcmp(U,T)==0){

		printf("%d %d", A, B-1);

	}

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define rep(i, n) for(int i = 0; i < n; i++)

using namespace std;

using ll = long long;

using P = pair<int, int>;

 

int main(){

	string s, t, u;

  	int a, b;

  	cin >> s >> t >> a >> b >> u;

  

  	if(u == s) a--;

  	else b--;

  	cout << a << " " << b << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.254705343743x):
#include <stdio.h>

#include <string.h>



int main(){

	int A, B;

	char S[25];

	char T[25];

	char U[25];

	

	scanf("%s %s", S, T);

	scanf("%d %d", &A, &B);

	scanf("%s", U);

	

	if(strcmp(U,S)==0){

		printf("%d %d", A-1, B);

	}else if(strcmp(U,T)==0){

		printf("%d %d", A, B-1);

	}

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <string>

#include <cstring>

#include <algorithm>





using namespace std;



int main()

{

    string s,t,ch;

    int a,b;

    cin>>s>>t;

    cin>>a>>b;

    cin>>ch;

    if(ch==s)

        a--;

    else if(ch==t)

        b--;

    cout<<a<<" "<<b;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.248552177743256x):
#include<stdio.h>

#include<string.h>

int main()

{

	char s[11];

	char t[11];

	char u[11];

	int x,y;

	scanf("%s %s",&s,&t);

	scanf("%d %d",&x,&y);

	scanf("%s",&u);

	if(strcmp(u,s) == 0){

		printf("%d %d",x-1,y );

}

	else if (strcmp(u,t) == 0) {

		printf("%d %d", x, y - 1);	

}

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int main() {

    string S,T,U;

    int A,B;

    cin >>S>>T;

    cin>>A>>B;

    cin>>U;

    if (S==U){

        A-=1;

    } else if (T==U){

        B-=1;

    }

    cout<<A<<" "<<B;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.248552177743256x):
#include<stdio.h>

#include<string.h>

int main()

{

	char s[11];

	char t[11];

	char u[11];

	int x,y;

	scanf("%s %s",&s,&t);

	scanf("%d %d",&x,&y);

	scanf("%s",&u);

	if(strcmp(u,s) == 0){

		printf("%d %d",x-1,y );

}

	else if (strcmp(u,t) == 0) {

		printf("%d %d", x, y - 1);	

}

	return 0;

}
// Slower C++ solution:
#include<iostream>

#include<cmath>

#include<string>

using namespace std;

int main(){

string x,s,e; cin>>x>>s;

int a,b; cin>>a>>b;

cin>>e;

if(x == e){

    a-=1;

}

else{

    b-=1;

}

cout<<a<<" "<<b;

}


// Faster C++ solution for the same problem (measured speedup: 5.248419690216094x):
#include<stdio.h>

#include<string.h>

int main()

{

	char s[11];

	char t[11];

	char u[11];

	int x,y;

	scanf("%s %s",&s,&t);

	scanf("%d %d",&x,&y);

	scanf("%s",&u);

	if(strcmp(u,s) == 0){

		printf("%d %d",x-1,y );

}

	else if (strcmp(u,t) == 0) {

		printf("%d %d", x, y - 1);	

}

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int main(){

    string s,t,u;

    int a,b;

    cin>>s;

    cin >>t;

    cin>>a;

    cin>>b;

    cin>>u;

    if (u==s){

        a--;

        cout<<a<<' '<<b;

    } else if (u==t){

        b--;

        cout<<a<<' '<<b;

    }



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.205509134643683x):
#include<stdio.h>

#include<string.h>

int main()

{

	char s[11];

	char t[11];

	char u[11];

	int x,y;

	scanf("%s %s",&s,&t);

	scanf("%d %d",&x,&y);

	scanf("%s",&u);

	if(strcmp(u,s) == 0){

		printf("%d %d",x-1,y );

}

	else if (strcmp(u,t) == 0) {

		printf("%d %d", x, y - 1);	

}

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int main()

{

    string s,t,u;

    int a,b;

    cin >> s >> t;

    cin >> a >> b;

    cin >> u;



    if(u == s){

        a--;

    }

    else if(u == t){

        b--;

    }



    cout << a << " " << b;

    return 0

    ;

}


// Faster C++ solution for the same problem (measured speedup: 5.248552177743256x):
#include<stdio.h>

#include<string.h>

int main()

{

	char s[11];

	char t[11];

	char u[11];

	int x,y;

	scanf("%s %s",&s,&t);

	scanf("%d %d",&x,&y);

	scanf("%s",&u);

	if(strcmp(u,s) == 0){

		printf("%d %d",x-1,y );

}

	else if (strcmp(u,t) == 0) {

		printf("%d %d", x, y - 1);	

}

	return 0;

}
// Slower C++ solution:
#include<iostream>

#include<string>

using namespace std;

int main ()

{

    string s;

    string t;

    int a,b;

    string u;

    cin>>s>>t;

    cin>>a>>b;

    cin>>u;

    if(u==s)

        cout<<a-1<<" "<<b<<endl;

    else if (u==t)

        cout<<a<<" "<<b-1<<endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.256755589695221x):
#include<stdio.h>

#include<string.h>

int main()

{

	char s[11];

	char t[11];

	char u[11];

	int x,y;

	scanf("%s %s",&s,&t);

	scanf("%d %d",&x,&y);

	scanf("%s",&u);

	if(strcmp(u,s) == 0){

		printf("%d %d",x-1,y );

}

	else if (strcmp(u,t) == 0) {

		printf("%d %d", x, y - 1);	

}

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define rep(i, n) for(int i = 0; i < n; i++)

using namespace std;

using ll = long long;

using P = pair<int, int>;

 

int main(){

	string s, t, u;

  	int a, b;

  	cin >> s >> t >> a >> b >> u;

  

  	if(u == s) a--;

  	else b--;

  	cout << a << " " << b << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.255521340748927x):
#include<stdio.h>

#include<string.h>

int main()

{

	char s[11];

	char t[11];

	char u[11];

	int x,y;

	scanf("%s %s",&s,&t);

	scanf("%d %d",&x,&y);

	scanf("%s",&u);

	if(strcmp(u,s) == 0){

		printf("%d %d",x-1,y );

}

	else if (strcmp(u,t) == 0) {

		printf("%d %d", x, y - 1);	

}

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <string>

#include <cstring>

#include <algorithm>





using namespace std;



int main()

{

    string s,t,ch;

    int a,b;

    cin>>s>>t;

    cin>>a>>b;

    cin>>ch;

    if(ch==s)

        a--;

    else if(ch==t)

        b--;

    cout<<a<<" "<<b;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.237687143092694x):
#include <stdio.h>

#include <string.h>



int main()

{

  char str1[15], str2[15], trash1[15];

  int balls1, balls2;



  scanf("%s %s", str1, str2);

  scanf("%d %d", &balls1, &balls2);

  scanf("%s", trash1);



  (strcmp(trash1, str1) == 0) ? balls1-- : balls2--;

  printf("%d %d\n", balls1, balls2);



  return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int main() {

    string S,T,U;

    int A,B;

    cin >>S>>T;

    cin>>A>>B;

    cin>>U;

    if (S==U){

        A-=1;

    } else if (T==U){

        B-=1;

    }

    cout<<A<<" "<<B;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.237687143092694x):
#include <stdio.h>

#include <string.h>



int main()

{

  char str1[15], str2[15], trash1[15];

  int balls1, balls2;



  scanf("%s %s", str1, str2);

  scanf("%d %d", &balls1, &balls2);

  scanf("%s", trash1);



  (strcmp(trash1, str1) == 0) ? balls1-- : balls2--;

  printf("%d %d\n", balls1, balls2);



  return 0;

}
// Slower C++ solution:
#include<iostream>

#include<cmath>

#include<string>

using namespace std;

int main(){

string x,s,e; cin>>x>>s;

int a,b; cin>>a>>b;

cin>>e;

if(x == e){

    a-=1;

}

else{

    b-=1;

}

cout<<a<<" "<<b;

}


// Faster C++ solution for the same problem (measured speedup: 5.237554929828134x):
#include <stdio.h>

#include <string.h>



int main()

{

  char str1[15], str2[15], trash1[15];

  int balls1, balls2;



  scanf("%s %s", str1, str2);

  scanf("%d %d", &balls1, &balls2);

  scanf("%s", trash1);



  (strcmp(trash1, str1) == 0) ? balls1-- : balls2--;

  printf("%d %d\n", balls1, balls2);



  return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int main(){

    string s,t,u;

    int a,b;

    cin>>s;

    cin >>t;

    cin>>a;

    cin>>b;

    cin>>u;

    if (u==s){

        a--;

        cout<<a<<' '<<b;

    } else if (u==t){

        b--;

        cout<<a<<' '<<b;

    }



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.194733203452305x):
#include <stdio.h>

#include <string.h>



int main()

{

  char str1[15], str2[15], trash1[15];

  int balls1, balls2;



  scanf("%s %s", str1, str2);

  scanf("%d %d", &balls1, &balls2);

  scanf("%s", trash1);



  (strcmp(trash1, str1) == 0) ? balls1-- : balls2--;

  printf("%d %d\n", balls1, balls2);



  return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int main()

{

    string s,t,u;

    int a,b;

    cin >> s >> t;

    cin >> a >> b;

    cin >> u;



    if(u == s){

        a--;

    }

    else if(u == t){

        b--;

    }



    cout << a << " " << b;

    return 0

    ;

}


// Faster C++ solution for the same problem (measured speedup: 5.237687143092694x):
#include <stdio.h>

#include <string.h>



int main()

{

  char str1[15], str2[15], trash1[15];

  int balls1, balls2;



  scanf("%s %s", str1, str2);

  scanf("%d %d", &balls1, &balls2);

  scanf("%s", trash1);



  (strcmp(trash1, str1) == 0) ? balls1-- : balls2--;

  printf("%d %d\n", balls1, balls2);



  return 0;

}
// Slower C++ solution:
#include<iostream>

#include<string>

using namespace std;

int main ()

{

    string s;

    string t;

    int a,b;

    string u;

    cin>>s>>t;

    cin>>a>>b;

    cin>>u;

    if(u==s)

        cout<<a-1<<" "<<b<<endl;

    else if (u==t)

        cout<<a<<" "<<b-1<<endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.245873573150969x):
#include <stdio.h>

#include <string.h>



int main()

{

  char str1[15], str2[15], trash1[15];

  int balls1, balls2;



  scanf("%s %s", str1, str2);

  scanf("%d %d", &balls1, &balls2);

  scanf("%s", trash1);



  (strcmp(trash1, str1) == 0) ? balls1-- : balls2--;

  printf("%d %d\n", balls1, balls2);



  return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define rep(i, n) for(int i = 0; i < n; i++)

using namespace std;

using ll = long long;

using P = pair<int, int>;

 

int main(){

	string s, t, u;

  	int a, b;

  	cin >> s >> t >> a >> b >> u;

  

  	if(u == s) a--;

  	else b--;

  	cout << a << " " << b << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.244641879225014x):
#include <stdio.h>

#include <string.h>



int main()

{

  char str1[15], str2[15], trash1[15];

  int balls1, balls2;



  scanf("%s %s", str1, str2);

  scanf("%d %d", &balls1, &balls2);

  scanf("%s", trash1);



  (strcmp(trash1, str1) == 0) ? balls1-- : balls2--;

  printf("%d %d\n", balls1, balls2);



  return 0;

}
// Slower C++ solution:
#include <iostream>



using namespace std;



int main()

{

    string x,y,z;

    int x1,y1;

    cin>>x>>y;

    cin>>x1>>y1;

    cin>>z;

    if(z==x){x1--;}

    else if(z==y){y1--;}

    cout<<x1<<" "<<y1<<endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.244014985737971x):
#include<stdio.h>

#include<string.h>



int main(){

int a,b;

char aName[15], bName[15], cName[15];

scanf("%s%s", aName, bName);

scanf("%d%d", &a, &b);

getchar();

scanf("%s", cName);

if(strcmp(cName,aName)==0)printf("%d %d\n", a-1, b);

else printf("%d %d\n", a, b-1);

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int main() {

string S,T,U;

int A,B;

cin >> S >> T >> A >> B >> U;

if(U==S){

  A-=1;

}else if (U==T){

  B-=1;

}

cout <<A<<" " <<B;

    return 0;}

// Faster C++ solution for the same problem (measured speedup: 5.237034032825178x):
#include<stdio.h>

#include<string.h>



int main(){

int a,b;

char aName[15], bName[15], cName[15];

scanf("%s%s", aName, bName);

scanf("%d%d", &a, &b);

getchar();

scanf("%s", cName);

if(strcmp(cName,aName)==0)printf("%d %d\n", a-1, b);

else printf("%d %d\n", a, b-1);

	return 0;

}
// Slower C++ solution:
#include <iostream>



using namespace std;



int main()



{

string c1 , c2 ,c3;

    cin>>c1>>c2;



    int no1,no2;

    cin>>no1>>no2;



    cin>>c3;



if (c1==c3){

    no1--;

}

else{

    no2--;

}

cout<<no1<<" "<<no2<<endl;





 return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.244098835274711x):
#include<stdio.h>

#include<string.h>



int main(){

int a,b;

char aName[15], bName[15], cName[15];

scanf("%s%s", aName, bName);

scanf("%d%d", &a, &b);

getchar();

scanf("%s", cName);

if(strcmp(cName,aName)==0)printf("%d %d\n", a-1, b);

else printf("%d %d\n", a, b-1);

	return 0;

}
// Slower C++ solution:
#include <iostream>



using namespace std;



int main()

{

    string s,a,u;

    int t,b;

    cin >>s>>a;

    cin>>t>>b;

    cin>>u;

    if (u==s){

        cout<<t-1<<' '<<b<<endl;

    }

    else{

        cout<<t<<' '<<b-1<<endl;

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.244529479846048x):
#include<stdio.h>

#include<string.h>



int main(){

int a,b;

char aName[15], bName[15], cName[15];

scanf("%s%s", aName, bName);

scanf("%d%d", &a, &b);

getchar();

scanf("%s", cName);

if(strcmp(cName,aName)==0)printf("%d %d\n", a-1, b);

else printf("%d %d\n", a, b-1);

	return 0;

}