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.276810735660428x):
#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;

    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.2027311707086685x):
#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 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 s1 , s2 , chosen;

    int n1 , n2;

    cin >> s1 >> s2 >> n1 >> n2 >> chosen;

    if (chosen == s1) n1--;

    else if (chosen == s2) n2--;

    cout << n1 << " " << n2;

    return 0;

}

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

#include <string.h>



int main()

{

    char ballA[15], ballB[15], input[15];

    int numBallA, numBallB;



    scanf("%s %s", ballA, ballB);

    scanf("%d %d%*c", &numBallA, &numBallB);

    scanf("%s", input);



    if (strcmp(input, ballA) == 0)

    {

        numBallA--;

    } else if (strcmp(input, ballB) == 0)

    {

        numBallB--;

    }



    printf("%d %d", numBallA, numBallB );



    return 0;

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

#include<string>



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{

        B--;

    }

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



    return 0;

}


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

#include <string.h>



int main()

{

    char ballA[15], ballB[15], input[15];

    int numBallA, numBallB;



    scanf("%s %s", ballA, ballB);

    scanf("%d %d%*c", &numBallA, &numBallB);

    scanf("%s", input);



    if (strcmp(input, ballA) == 0)

    {

        numBallA--;

    } else if (strcmp(input, ballB) == 0)

    {

        numBallB--;

    }



    printf("%d %d", numBallA, numBallB );



    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--;

    } else B--;

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



    return 0;

}

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

#include <string.h>



int main()

{

    char ballA[15], ballB[15], input[15];

    int numBallA, numBallB;



    scanf("%s %s", ballA, ballB);

    scanf("%d %d%*c", &numBallA, &numBallB);

    scanf("%s", input);



    if (strcmp(input, ballA) == 0)

    {

        numBallA--;

    } else if (strcmp(input, ballB) == 0)

    {

        numBallB--;

    }



    printf("%d %d", numBallA, numBallB );



    return 0;

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



using namespace std;



int main()

{



    string firstType, secondType, chosenType;

    int firstTypeNumber, secondTypeNumber;



    cin >> firstType >> secondType >> firstTypeNumber

    >> secondTypeNumber >> chosenType;



    if (chosenType == firstType){

        firstTypeNumber--;

    }



    else{

        secondTypeNumber--;

    }



    cout << firstTypeNumber << " " << secondTypeNumber;



    return 0;

}


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

#include <string.h>



int main()

{

    char ballA[15], ballB[15], input[15];

    int numBallA, numBallB;



    scanf("%s %s", ballA, ballB);

    scanf("%d %d%*c", &numBallA, &numBallB);

    scanf("%s", input);



    if (strcmp(input, ballA) == 0)

    {

        numBallA--;

    } else if (strcmp(input, ballB) == 0)

    {

        numBallB--;

    }



    printf("%d %d", numBallA, numBallB );



    return 0;

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

using namespace std;

int main(){

    string s1 , s2 , chosen;

    int n1 , n2;

    cin >> s1 >> s2 >> n1 >> n2 >> chosen;

    if (chosen == s1) n1--;

    else if (chosen == s2) n2--;

    cout << n1 << " " << n2;

    return 0;

}

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

#include<string.h>



int main(){

	

	char s[11];

	char t[11];

	char u[11];

	int a;

	int b;

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

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

	scanf("%s",&u);

	

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

		printf("eror!");

	}

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

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

	}

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

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

	}

	

	

	

	

	

	return 0;

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

#include<string>



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{

        B--;

    }

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



    return 0;

}


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

#include<string.h>



int main(){

	

	char s[11];

	char t[11];

	char u[11];

	int a;

	int b;

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

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

	scanf("%s",&u);

	

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

		printf("eror!");

	}

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

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

	}

	else if(strcmp(t,u) == 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--;

    } else B--;

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



    return 0;

}

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

#include<string.h>



int main(){

	

	char s[11];

	char t[11];

	char u[11];

	int a;

	int b;

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

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

	scanf("%s",&u);

	

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

		printf("eror!");

	}

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

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

	}

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

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

	}

	

	

	

	

	

	return 0;

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



using namespace std;



int main()

{



    string firstType, secondType, chosenType;

    int firstTypeNumber, secondTypeNumber;



    cin >> firstType >> secondType >> firstTypeNumber

    >> secondTypeNumber >> chosenType;



    if (chosenType == firstType){

        firstTypeNumber--;

    }



    else{

        secondTypeNumber--;

    }



    cout << firstTypeNumber << " " << secondTypeNumber;



    return 0;

}


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

#include<string.h>



int main(){

	

	char s[11];

	char t[11];

	char u[11];

	int a;

	int b;

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

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

	scanf("%s",&u);

	

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

		printf("eror!");

	}

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

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

	}

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

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

	}

	

	

	

	

	

	return 0;

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

using namespace std;

int main(){

    string s1 , s2 , chosen;

    int n1 , n2;

    cin >> s1 >> s2 >> n1 >> n2 >> chosen;

    if (chosen == s1) n1--;

    else if (chosen == s2) n2--;

    cout << n1 << " " << n2;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.237583436716813x):
#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);

	scanf("%s",&u);

	

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

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

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

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

	}

	



return 0;

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

#include<string>



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{

        B--;

    }

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



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.237509990229771x):
#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);

	scanf("%s",&u);

	

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

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

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

		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--;

    } else B--;

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



    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.237509990229771x):
#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);

	scanf("%s",&u);

	

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

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

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

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

	}

	



return 0;

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



using namespace std;



int main()

{



    string firstType, secondType, chosenType;

    int firstTypeNumber, secondTypeNumber;



    cin >> firstType >> secondType >> firstTypeNumber

    >> secondTypeNumber >> chosenType;



    if (chosenType == firstType){

        firstTypeNumber--;

    }



    else{

        secondTypeNumber--;

    }



    cout << firstTypeNumber << " " << secondTypeNumber;



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.196246646406351x):
#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);

	scanf("%s",&u);

	

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

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

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

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

	}

	



return 0;

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

using namespace std;

int main(){

    string s1 , s2 , chosen;

    int n1 , n2;

    cin >> s1 >> s2 >> n1 >> n2 >> chosen;

    if (chosen == s1) n1--;

    else if (chosen == s2) n2--;

    cout << n1 << " " << n2;

    return 0;

}

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

#include <string.h>



int main () {

    

    char x[12];

    char y[12];

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

    int a,b;

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

    char z[12];

    scanf("%s",&z);

    

    if(strcmp(z,x)==0) {

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

    }

    else if(strcmp(z,y)==0) {

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

    }



    return 0;

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

#include<string>



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{

        B--;

    }

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



    return 0;

}


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

#include <string.h>



int main () {

    

    char x[12];

    char y[12];

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

    int a,b;

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

    char z[12];

    scanf("%s",&z);

    

    if(strcmp(z,x)==0) {

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

    }

    else if(strcmp(z,y)==0) {

        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--;

    } else B--;

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



    return 0;

}

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

#include <string.h>



int main () {

    

    char x[12];

    char y[12];

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

    int a,b;

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

    char z[12];

    scanf("%s",&z);

    

    if(strcmp(z,x)==0) {

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

    }

    else if(strcmp(z,y)==0) {

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

    }



    return 0;

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



using namespace std;



int main()

{



    string firstType, secondType, chosenType;

    int firstTypeNumber, secondTypeNumber;



    cin >> firstType >> secondType >> firstTypeNumber

    >> secondTypeNumber >> chosenType;



    if (chosenType == firstType){

        firstTypeNumber--;

    }



    else{

        secondTypeNumber--;

    }



    cout << firstTypeNumber << " " << secondTypeNumber;



    return 0;

}


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

#include <string.h>



int main () {

    

    char x[12];

    char y[12];

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

    int a,b;

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

    char z[12];

    scanf("%s",&z);

    

    if(strcmp(z,x)==0) {

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

    }

    else if(strcmp(z,y)==0) {

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

    }



    return 0;

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

using namespace std;

int main(){

    string s1 , s2 , chosen;

    int n1 , n2;

    cin >> s1 >> s2 >> n1 >> n2 >> chosen;

    if (chosen == s1) n1--;

    else if (chosen == s2) n2--;

    cout << n1 << " " << n2;

    return 0;

}

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

#include<string.h>



int main(){

	char a[11], b[11], c[11];

	int d, e;

	scanf("%s %s\n", &a, &b);

	scanf("%d %d\n", &d, &e);

	scanf("%s", &c);

	

	if(strcmp(a, c) == 0) {

		printf("%d %d", d - 1, e);

	}

	else if (strcmp(b, c) == 0){

		printf("%d %d", d, e - 1);

	}

		

	return 0;

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

#include<string>



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{

        B--;

    }

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



    return 0;

}


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

#include<string.h>



int main(){

	char a[11], b[11], c[11];

	int d, e;

	scanf("%s %s\n", &a, &b);

	scanf("%d %d\n", &d, &e);

	scanf("%s", &c);

	

	if(strcmp(a, c) == 0) {

		printf("%d %d", d - 1, e);

	}

	else if (strcmp(b, c) == 0){

		printf("%d %d", d, e - 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--;

    } else B--;

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



    return 0;

}

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

#include<string.h>



int main(){

	char a[11], b[11], c[11];

	int d, e;

	scanf("%s %s\n", &a, &b);

	scanf("%d %d\n", &d, &e);

	scanf("%s", &c);

	

	if(strcmp(a, c) == 0) {

		printf("%d %d", d - 1, e);

	}

	else if (strcmp(b, c) == 0){

		printf("%d %d", d, e - 1);

	}

		

	return 0;

}