Language: C++

#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<queue>
#include<stack>
#include<iomanip>
#include<sstream>

#define fast_io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

using namespace std;

#define deb(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) { cout << '\n';}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cout << '[' << *it << " = " << a << "]  ";
    err(++it, args...);
}

#define fcout cout<<fixed<<setprecision(15)
#define repp(i,j,k) for(int i=j; i<k; ++i)
#define rep(i,j) repp(i,0,j)
#define rrep(i,j,k) for(int i=j; i>=k; --i)
#define all(x) (x).begin(), (x).end()
#define sort(x) sort(x.begin(), x.end())
#define lb(x,val) lower_bound(x.begin(), x.end(), val)
#define ub(x,val) upper_bound(x.begin(), x.end(), val)
#define pb(x) emplace_back(x);

typedef long long int lli;
typedef pair<int,int> pii;
typedef pair<lli,lli> pll;
typedef vector<int> vi;
typedef vector<lli> vl;
typedef tuple<lli, lli> tii;
typedef tuple<lli, lli, lli> tiii;

//const lli M=998244353ll;
const lli M=1000000007ll;
const double D=1.0;


void solve(){
	string sa,sb,sc; cin>>sa>>sb>>sc;
	int ca=0,cb=0,cc=0;
	int t=0;
	while(1){
		if(0){
			t=sa[ca++]-'a';
			if(ca==sa.size()){
				cout<<"A";
				break;
			}
		}else if(1){
			t=sb[cb++]-'a';
			if(cb==sb.size()){
				cout<<"B";
				break;
			}		
		}else{
			t=sc[cc++]-'a';
			if(cc=sc.size()){
				cout<<"C"
				break;
			}		
		}	
	}
}

int main(){
	fast_io
	int tc=1;
	//cin>>tc;
	while(tc--){solve();}
	return 0;
}

Compiler output:
a.cc:18:6: error: variable or field 'err' declared void
   18 | void err(istream_iterator<string> it) { cout << '\n';}
      |      ^~~
a.cc:18:10: error: 'istream_iterator' was not declared in this scope
   18 | void err(istream_iterator<string> it) { cout << '\n';}
      |          ^~~~~~~~~~~~~~~~
a.cc:11:1: note: 'std::istream_iterator' is defined in header '<iterator>'; this is probably fixable by adding '#include <iterator>'
   10 | #include<iomanip>
  +++ |+#include <iterator>
   11 | #include<sstream>
a.cc:18:33: error: expected primary-expression before '>' token
   18 | void err(istream_iterator<string> it) { cout << '\n';}
      |                                 ^
a.cc:18:35: error: 'it' was not declared in this scope; did you mean 'int'?
   18 | void err(istream_iterator<string> it) { cout << '\n';}
      |                                   ^~
      |                                   int
a.cc:20:6: error: variable or field 'err' declared void
   20 | void err(istream_iterator<string> it, T a, Args... args) {
      |      ^~~
a.cc:20:10: error: 'istream_iterator' was not declared in this scope
   20 | void err(istream_iterator<string> it, T a, Args... args) {
      |          ^~~~~~~~~~~~~~~~
a.cc:20:10: note: 'std::istream_iterator' is defined in header '<iterator>'; this is probably fixable by adding '#include <iterator>'
a.cc:20:33: error: expected primary-expression before '>' token
   20 | void err(istream_iterator<string> it, T a, Args... args) {
      |                                 ^
a.cc:20:35: error: 'it' was not declared in this scope; did you mean 'int'?
   20 | void err(istream_iterator<string> it, T a, Args... args) {
      |                                   ^~
      |                                   int
a.cc:20:41: error: expected primary-expression before 'a'
   20 | void err(istream_iterator<string> it, T a, Args... args) {
      |                                         ^
a.cc:20:48: error: expected primary-expression before '...' token
   20 | void err(istream_iterator<string> it, T a, Args... args) {
      |                                                ^~~
a.cc: In function 'void solve()':
a.cc:68:42: error: expected ';' before 'break'
   68 |                                 cout<<"C"
      |                                          ^
      |                                          ;
   69 |                                 break;
      |                                 ~~~~~