For this Question: You are given three string A, B, C consisting of only characters 'a', 'b' and 'c'. You need to follow the given procedure:
-> Initially start with string A.
-> At each turn, if the current string contains atleast 1 character, remove the first character. Now if the removed character is a, turn goes to string A. Similarly b -> B, and c -> C.
-> If the current string has no character, output the string name.

Note: The length of the strings maybe different

See sample for better understanding.The input consists of 3 lines containing strings A, B, C.

Constraints
1 <= |A|, |B|, |C| <= 1000

Output a single character A or B or C.Sample Input
aca
accc
ca

Sample Output
A

Explanation
Initially its turn of string A. Its first character is a, 'a' gets removed from the string. The turn goes to A. Now its first character is 'c', 'c' gets removed from the string. The turn goes to C. Now its first character is 'c', 'c' gets removed from the string. The turn goes to C. Now its first character is 'a', 'a' gets removed from the string. The turn goes to A. Now its first character is 'a', 'a' gets removed from the string. The turn goes to A.
Since string A is empty, the answer is A.  , I have written this Solution Code: #include <bits/stdc++.h>
using namespace std;
#define sd(x) scanf("%d", &x)
#define sz(v) (int) v.size()
#define pr(v) For(i, 0, sz(v)) {cout<<v[i]<<" ";} cout<<endl;
#define slld(x) scanf("%lld", &x)
#define all(x) x.begin(), x.end()
#define For(i, st, en) for(ll i=st; i<en; i++)
#define tr(x) for(auto it=x.begin(); it!=x.end(); it++)
#define fast std::ios::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define ll long long
#define int long long
#define mp make_pair
#define F first
#define S second
typedef pair<int, int> pii;
typedef vector<int> vi;
#define MOD 1000000007
#define INF 1000000000000000007LL

const int N = 100005;
 
// it's swapnil07 ;)
 
#ifdef SWAPNIL07
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cout << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
int begtime = clock();
#define end_routine() cout << "\n\nTime elapsed: " << (clock() - begtime)*1000/CLOCKS_PER_SEC << " ms\n\n";
#else
#define endl '\n'
#define trace(...)
#define end_routine()
#endif


signed main()
{
    fast
    #ifdef SWAPNIL07
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    #endif
    string s[3];
    For(i, 0, 3){
        cin>>s[i];
        reverse(all(s[i]));
    }
    int cur = 0;
    while(true){
        char player = 'a'+cur;
        if(sz(s[cur])==0){
            char c = 'A'+cur;
            cout<<c;
            return 0;
        }
        int temp = (s[cur].back())-'a';
        s[cur].pop_back();
        cur = temp;
    }
    return 0;
}




, In this Programming Language: C++, Now tell me if this Code is compilable or not?