#include<bits/stdc++.h>
#include<cmath>
using namespace std;
char a[10001];
char zh[100001];
char mima[100001];
char youxiang[100001];
int tot=0;
char ans[1500][1000001];
char kong[1]={' '};
int main()
{
    gets(a);
    int n;
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        cin>>zh>>mima>>youxiang;

        if(strcmp(a,youxiang)==0)
        {
            int l=strlen(mima);
            for(int i=0;i<l;i++)
            {
                if(mima[i]>=65&&mima[i]<=90)mima[i]=mima[i]+32;
                else if(mima[i]>=97&&mima[i]<=122)mima[i]=mima[i]-32;
            }

            cout<<zh<<" "<<mima<<"\n";
            tot++;

        }
    }
    if(tot==0)
    {
        cout<<"empty";
        return 0;
    }

    return 0;
}

2 comments

  • 1

Information

ID
7058
Time
1000ms
Memory
256MiB
Difficulty
5
Tags
# Submissions
626
Accepted
155
Uploaded By