Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
	string A,B,C,D={};
  	cin >> A >> B >> C;	
  	D=A;
  	while(A[0]!="" && (B[0]!="" && C[0]!="")){
    	if(D==A){
          	if(A[0]==a){
            	A = A.substr(1,A.size()-1);
              	D = A;
            }
          	else if(A[0]==b){
            	A = A.substr(1,A.size()-1);
              	D = B;
            }
          	else if(A[0]==c){
            	A = A.substr(1,A.size()-1);
              	D = C;
            }
        	
          
        }
      	if(D==B){
          	if(B[0]==a){
            	B = B.substr(1,B.size()-1);
              	D = A;
            }
          	else if(B[0]==b){
            	B = B.substr(1,B.size()-1);
              	D = B;
            }
          	else if(B[0]==c){
            	B = B.substr(1,B.size()-1);
              	D = C;
            }
        	
          
        }
      	if(D==C){
          	if(C[0]==a){
            	C = C.substr(1,C.size()-1);
              	D = A;
            }
          	else if(C[0]==b){
            	C = C.substr(1,C.size()-1);
              	D = B;
            }
          	else if(C[0]==c){
            	C = C.substr(1,C.size()-1);
              	D = C;
            }
        	
          
        }
      	
    }
  	if(A=={}) cout << "A" << endl;
  	else if(B=={}) cout << "B" << endl;
  	else if(C=={}) cout << "C" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |         while(A[0]!="" && (B[0]!="" && C[0]!="")){
a.cc:8:32: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |         while(A[0]!="" && (B[0]!="" && C[0]!="")){
a.cc:8:44: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |         while(A[0]!="" && (B[0]!="" && C[0]!="")){
a.cc:10:26: error: 'a' was not declared in this scope
   10 |                 if(A[0]==a){
      |                          ^
a.cc:14:31: error: 'b' was not declared in this scope
   14 |                 else if(A[0]==b){
      |                               ^
a.cc:18:31: error: 'c' was not declared in this scope
   18 |                 else if(A[0]==c){
      |                               ^
a.cc:26:26: error: 'a' was not declared in this scope
   26 |                 if(B[0]==a){
      |                          ^
a.cc:30:31: error: 'b' was not declared in this scope
   30 |                 else if(B[0]==b){
      |                               ^
a.cc:34:31: error: 'c' was not declared in this scope
   34 |                 else if(B[0]==c){
      |                               ^
a.cc:42:26: error: 'a' was not declared in this scope
   42 |                 if(C[0]==a){
      |                          ^
a.cc:46:31: error: 'b' was not declared in this scope
   46 |                 else if(C[0]==b){
      |                               ^
a.cc:50:31: error: 'c' was not declared in this scope
   50 |                 else if(C[0]==c){
      |                               ^
a.cc:59:15: error: expected primary-expression before '{' token
   59 |         if(A=={}) cout << "A" << endl;
      |               ^
a.cc:59:15: error: expected ')' before '{' token
   59 |         if(A=={}) cout << "A" << endl;
      |           ~   ^
      |               )
a.cc:60:20: error: expected primary-expression before '{' token
   60 |         else if(B=={}) cout << "B" << endl;
      |                    ^
a.cc:60:20: error: expected ')' before '{' token
   60 |         else if(B=={}) cout << "B" << endl;
      |                ~   ^
      |                    )
a.cc:61:20: error: expected primary-expression before '{' token
   61 |         else if(C=={}) cout << "C" << endl;
      |                    ^
a.cc:61:20: error: expected ')' before '{' token
   61 |         else if(C=={}) cout << "C" << endl;
      |                ~   ^
      |                    )