stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#pragma GCC optimize ("O3")

///#include<bits/stdc++.h>

#include<iostream>

#include<string>

using namespace std;







/// Info.

///****************************************************************************************************************************************///

/// Coder               : BAHAA El_DEEN OSAMA SAYED.

/// Problem name        : F - Remaining Balls

/// Method              : IM-string

/// Date                : 23/2/2020

///****************************************************************************************************************************************///





#define rep0(i,x)         for(int i=0; i<=x ;++i)

#define all(v)           ((v.begin()),((v.end())

#define mm(v,d)          memset(v,d,sizeof(v))

#define lp(i,v)          for(int i=0;i<sizeof(v);++i)

#define lpi(i,j,n)       for(int i=(j);i>=(int)n;++i)

#define lpd(i,j,n)       for(int i=(j);i>=(int)n;--i)

#define MP               make_pair

#define SZ(v)            ((int) ( (v).size() ) )

#define ull              unsigned long long

#define ll               long long

#define pi               3.1415926536

#define oo               1e9

#define OO               1e18

#define Fx(n)            fixed<<setprecision(n)

#define FasterIO           std::ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)

#define RE0              return 0

#define RE1              return 1

#define mp(a,b)          make_pair(a,b)

#define X                first

#define Y                second

#define pii              pair(int a, int b)

#define rep1(i,x)        for(int i=1;i<x;++i)

#define rep2(i,x)        for(int i=2;i<x;++i)

#define RE               return

//#define LD               long double

#define all(v) ((v).begin()),((v).end())





const  int  N   = (int) 1e5+100;

const  int  M   = (int) 1e4+4;

const  int  INF = (int) 0x3f3f3f3f;

///const double ESP = 1e-7;

///const ll MOD=1e8+9;





string str1,str2,str3;

int a=0,b=0;



int main()

{

FasterIO;



cin>> str1 >> str2 ;

cin >> a   >> b;

cin >> str3;

(str1==str3) ? --a : --b;

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







 RE0;}


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

#include<string.h>

	int main(){

	int A,B;

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

	

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

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

	getchar();

	scanf("%s",&U);

	

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

		A--;

		

	}

	else {

		B--;

	}		

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

		

		

		

		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;

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

    }else{

        b-=1;

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

    }

    return 0;

}

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

#include<string.h>

	int main(){

	int A,B;

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

	

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

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

	getchar();

	scanf("%s",&U);

	

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

		A--;

		

	}

	else {

		B--;

	}		

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

		

		

		

		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.2479265912522814x):
#include <stdio.h>

#include <string.h>



int main()

{

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

	int A, B;

	

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

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

	scanf ("%s", U);

	

	(strcmp (S,U) == 0) ? A-- : B--;

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

	

	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.2409404311205945x):
#include <stdio.h>

#include <string.h>



int main()

{

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

	int A, B;

	

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

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

	scanf ("%s", U);

	

	(strcmp (S,U) == 0) ? A-- : B--;

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

	

	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.248010503333905x):
#include <stdio.h>

#include <string.h>



int main()

{

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

	int A, B;

	

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

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

	scanf ("%s", U);

	

	(strcmp (S,U) == 0) ? A-- : B--;

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

	

	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.248441469130808x):
#include <stdio.h>

#include <string.h>



int main()

{

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

	int A, B;

	

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

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

	scanf ("%s", U);

	

	(strcmp (S,U) == 0) ? A-- : B--;

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

	

	return 0;	

}
// Slower C++ solution:
#pragma GCC optimize ("O3")

///#include<bits/stdc++.h>

#include<iostream>

#include<string>

using namespace std;







/// Info.

///****************************************************************************************************************************************///

/// Coder               : BAHAA El_DEEN OSAMA SAYED.

/// Problem name        : F - Remaining Balls

/// Method              : IM-string

/// Date                : 23/2/2020

///****************************************************************************************************************************************///





#define rep0(i,x)         for(int i=0; i<=x ;++i)

#define all(v)           ((v.begin()),((v.end())

#define mm(v,d)          memset(v,d,sizeof(v))

#define lp(i,v)          for(int i=0;i<sizeof(v);++i)

#define lpi(i,j,n)       for(int i=(j);i>=(int)n;++i)

#define lpd(i,j,n)       for(int i=(j);i>=(int)n;--i)

#define MP               make_pair

#define SZ(v)            ((int) ( (v).size() ) )

#define ull              unsigned long long

#define ll               long long

#define pi               3.1415926536

#define oo               1e9

#define OO               1e18

#define Fx(n)            fixed<<setprecision(n)

#define FasterIO           std::ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)

#define RE0              return 0

#define RE1              return 1

#define mp(a,b)          make_pair(a,b)

#define X                first

#define Y                second

#define pii              pair(int a, int b)

#define rep1(i,x)        for(int i=1;i<x;++i)

#define rep2(i,x)        for(int i=2;i<x;++i)

#define RE               return

//#define LD               long double

#define all(v) ((v).begin()),((v).end())





const  int  N   = (int) 1e5+100;

const  int  M   = (int) 1e4+4;

const  int  INF = (int) 0x3f3f3f3f;

///const double ESP = 1e-7;

///const ll MOD=1e8+9;





string str1,str2,str3;

int a=0,b=0;



int main()

{

FasterIO;



cin>> str1 >> str2 ;

cin >> a   >> b;

cin >> str3;

(str1==str3) ? --a : --b;

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







 RE0;}


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

#include <string.h>



int main()

{

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

	int A, B;

	

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

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

	scanf ("%s", U);

	

	(strcmp (S,U) == 0) ? A-- : B--;

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

	

	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;

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

    }else{

        b-=1;

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

    }

    return 0;

}

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

#include <string.h>



int main()

{

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

	int A, B;

	

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

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

	scanf ("%s", U);

	

	(strcmp (S,U) == 0) ? A-- : B--;

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

	

	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.25032890483196x):
#include <stdio.h>



int main (){

	

	char s[100], t[100], u[100];

	int a,b;

	int x = 0;

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

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

	getchar();

	scanf ("%s", u);

	

	for(int i = 0 ; s[i] != '\0' || t[i] != '\0' ; i++ ){

		if(s[i] != u[i]){

		x = 1;

		break;

		}

	}

	if (x == 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.243339546685388x):
#include <stdio.h>



int main (){

	

	char s[100], t[100], u[100];

	int a,b;

	int x = 0;

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

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

	getchar();

	scanf ("%s", u);

	

	for(int i = 0 ; s[i] != '\0' || t[i] != '\0' ; i++ ){

		if(s[i] != u[i]){

		x = 1;

		break;

		}

	}

	if (x == 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.250412855325542x):
#include <stdio.h>



int main (){

	

	char s[100], t[100], u[100];

	int a,b;

	int x = 0;

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

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

	getchar();

	scanf ("%s", u);

	

	for(int i = 0 ; s[i] != '\0' || t[i] != '\0' ; i++ ){

		if(s[i] != u[i]){

		x = 1;

		break;

		}

	}

	if (x == 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.250844018403212x):
#include <stdio.h>



int main (){

	

	char s[100], t[100], u[100];

	int a,b;

	int x = 0;

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

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

	getchar();

	scanf ("%s", u);

	

	for(int i = 0 ; s[i] != '\0' || t[i] != '\0' ; i++ ){

		if(s[i] != u[i]){

		x = 1;

		break;

		}

	}

	if (x == 0){

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

	}

	else {

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

	}

	return 0;

}
// Slower C++ solution:
#pragma GCC optimize ("O3")

///#include<bits/stdc++.h>

#include<iostream>

#include<string>

using namespace std;







/// Info.

///****************************************************************************************************************************************///

/// Coder               : BAHAA El_DEEN OSAMA SAYED.

/// Problem name        : F - Remaining Balls

/// Method              : IM-string

/// Date                : 23/2/2020

///****************************************************************************************************************************************///





#define rep0(i,x)         for(int i=0; i<=x ;++i)

#define all(v)           ((v.begin()),((v.end())

#define mm(v,d)          memset(v,d,sizeof(v))

#define lp(i,v)          for(int i=0;i<sizeof(v);++i)

#define lpi(i,j,n)       for(int i=(j);i>=(int)n;++i)

#define lpd(i,j,n)       for(int i=(j);i>=(int)n;--i)

#define MP               make_pair

#define SZ(v)            ((int) ( (v).size() ) )

#define ull              unsigned long long

#define ll               long long

#define pi               3.1415926536

#define oo               1e9

#define OO               1e18

#define Fx(n)            fixed<<setprecision(n)

#define FasterIO           std::ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)

#define RE0              return 0

#define RE1              return 1

#define mp(a,b)          make_pair(a,b)

#define X                first

#define Y                second

#define pii              pair(int a, int b)

#define rep1(i,x)        for(int i=1;i<x;++i)

#define rep2(i,x)        for(int i=2;i<x;++i)

#define RE               return

//#define LD               long double

#define all(v) ((v).begin()),((v).end())





const  int  N   = (int) 1e5+100;

const  int  M   = (int) 1e4+4;

const  int  INF = (int) 0x3f3f3f3f;

///const double ESP = 1e-7;

///const ll MOD=1e8+9;





string str1,str2,str3;

int a=0,b=0;



int main()

{

FasterIO;



cin>> str1 >> str2 ;

cin >> a   >> b;

cin >> str3;

(str1==str3) ? --a : --b;

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







 RE0;}


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



int main (){

	

	char s[100], t[100], u[100];

	int a,b;

	int x = 0;

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

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

	getchar();

	scanf ("%s", u);

	

	for(int i = 0 ; s[i] != '\0' || t[i] != '\0' ; i++ ){

		if(s[i] != u[i]){

		x = 1;

		break;

		}

	}

	if (x == 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;

    cin>>a>>b;

    cin>>u;

    if (s==u){

        a-=1;

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

    }else{

        b-=1;

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

    }

    return 0;

}

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



int main (){

	

	char s[100], t[100], u[100];

	int a,b;

	int x = 0;

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

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

	getchar();

	scanf ("%s", u);

	

	for(int i = 0 ; s[i] != '\0' || t[i] != '\0' ; i++ ){

		if(s[i] != u[i]){

		x = 1;

		break;

		}

	}

	if (x == 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 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.242636974942591x):
#include<stdio.h>

#include<string.h>

int main()

{

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

	int balls1, balls2;

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

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

	scanf("%s", trash);

	(strcmp(trash, 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 >> 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.235657856469344x):
#include<stdio.h>

#include<string.h>

int main()

{

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

	int balls1, balls2;

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

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

	scanf("%s", trash);

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

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

	

	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.2427208024455325x):
#include<stdio.h>

#include<string.h>

int main()

{

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

	int balls1, balls2;

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

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

	scanf("%s", trash);

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

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

	

	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.24315133385303x):
#include<stdio.h>

#include<string.h>

int main()

{

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

	int balls1, balls2;

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

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

	scanf("%s", trash);

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

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

	

	return 0;

	

}
// Slower C++ solution:
#pragma GCC optimize ("O3")

///#include<bits/stdc++.h>

#include<iostream>

#include<string>

using namespace std;







/// Info.

///****************************************************************************************************************************************///

/// Coder               : BAHAA El_DEEN OSAMA SAYED.

/// Problem name        : F - Remaining Balls

/// Method              : IM-string

/// Date                : 23/2/2020

///****************************************************************************************************************************************///





#define rep0(i,x)         for(int i=0; i<=x ;++i)

#define all(v)           ((v.begin()),((v.end())

#define mm(v,d)          memset(v,d,sizeof(v))

#define lp(i,v)          for(int i=0;i<sizeof(v);++i)

#define lpi(i,j,n)       for(int i=(j);i>=(int)n;++i)

#define lpd(i,j,n)       for(int i=(j);i>=(int)n;--i)

#define MP               make_pair

#define SZ(v)            ((int) ( (v).size() ) )

#define ull              unsigned long long

#define ll               long long

#define pi               3.1415926536

#define oo               1e9

#define OO               1e18

#define Fx(n)            fixed<<setprecision(n)

#define FasterIO           std::ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)

#define RE0              return 0

#define RE1              return 1

#define mp(a,b)          make_pair(a,b)

#define X                first

#define Y                second

#define pii              pair(int a, int b)

#define rep1(i,x)        for(int i=1;i<x;++i)

#define rep2(i,x)        for(int i=2;i<x;++i)

#define RE               return

//#define LD               long double

#define all(v) ((v).begin()),((v).end())





const  int  N   = (int) 1e5+100;

const  int  M   = (int) 1e4+4;

const  int  INF = (int) 0x3f3f3f3f;

///const double ESP = 1e-7;

///const ll MOD=1e8+9;





string str1,str2,str3;

int a=0,b=0;



int main()

{

FasterIO;



cin>> str1 >> str2 ;

cin >> a   >> b;

cin >> str3;

(str1==str3) ? --a : --b;

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







 RE0;}


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

#include<string.h>

int main()

{

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

	int balls1, balls2;

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

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

	scanf("%s", trash);

	(strcmp(trash, 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;

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

    }else{

        b-=1;

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

    }

    return 0;

}

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

#include<string.h>

int main()

{

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

	int balls1, balls2;

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

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

	scanf("%s", trash);

	(strcmp(trash, 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.2493441751682095x):
#include<stdio.h>

#include<string.h>



int main()

{

	

	char S[15];

	char U[15];

	char T[15];

	int A;

	int B;

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

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

	{

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

	}

	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 >> 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.242356127916331x):
#include<stdio.h>

#include<string.h>



int main()

{

	

	char S[15];

	char U[15];

	char T[15];

	int A;

	int B;

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

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

	{

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

	}

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

	{

		printf("%d %d",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.249428109916389x):
#include<stdio.h>

#include<string.h>



int main()

{

	

	char S[15];

	char U[15];

	char T[15];

	int A;

	int B;

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

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

	{

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

	}

	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,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.24985919212692x):
#include<stdio.h>

#include<string.h>



int main()

{

	

	char S[15];

	char U[15];

	char T[15];

	int A;

	int B;

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

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

	{

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

	}

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

	{

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

	}

	

	return 0;	

}