Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb pushback
#define fr(i,n) for(int i=0;i<n;i++)
#define fro(i,j,n) for(int i=j;i<n;i++)
#define ifr(i,n) for(int i=n-1;i>=0;i--)

int main() {
    int n;
	cin >> n;
    int a,b,c;
    cin >> a >> b >> c;
    string s[n];
    string ans="Yes";
    fr(i,n){
     cin >> s[i];
    }
    fr(i,n){
     if(s[i]=="ab"){
       if(a==0&&b=0){
         ans="No"
       }else if(a<b){
         b-=1;
         a+=1;
       }else{
         a-=1;
         b+=1;
       }
     }
      if(s[i]=="ac"){
       if(a==0&&c=0){
         ans="No"
       }else if(a<c){
         c-=1;
         a+=1;
       }else{
         a-=1;
         c+=1;
       }
     }
      if(s[i]=="bc"){
       if(b==0&&c=0){
         ans="No"
       }else if(b<c){
         c-=1;
         b+=1;
       }else{
         b-=1;
         c+=1;
       }
     }
    }
    cout << ans << endl;
  	if(ans=="Yes"){
     fr(i,n){
     if(s[i]=="ab"){
       if(a==0&&b=0){
         ans="No"
       }else if(a<b){
         b-=1;
         a+=1;
         cout << "a" << endl;
       }else{
         a-=1;
         b+=1;
         cout << "b" << endl;
       }
     }
      if(s[i]=="ac"){
       if(a==0&&c=0){
         ans="No"
       }else if(a<c){
         c-=1;
         a+=1;
         cout << "a" << endl;
       }else{
         a-=1;
         c+=1;
         cout << "c" << endl;
       }
     }
      if(s[i]=="bc"){
       if(b==0&&c=0){
         ans="No"
       }else if(b<c){
         c-=1;
         b+=1;
         cout << "b" << endl;
       }else{
         b-=1;
         c+=1;
         cout << "c" << endl;
       }
     }
    }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:15: error: lvalue required as left operand of assignment
   21 |        if(a==0&&b=0){
      |           ~~~~^~~
a.cc:22:18: error: expected ';' before '}' token
   22 |          ans="No"
      |                  ^
      |                  ;
   23 |        }else if(a<b){
      |        ~          
a.cc:32:15: error: lvalue required as left operand of assignment
   32 |        if(a==0&&c=0){
      |           ~~~~^~~
a.cc:33:18: error: expected ';' before '}' token
   33 |          ans="No"
      |                  ^
      |                  ;
   34 |        }else if(a<c){
      |        ~          
a.cc:43:15: error: lvalue required as left operand of assignment
   43 |        if(b==0&&c=0){
      |           ~~~~^~~
a.cc:44:18: error: expected ';' before '}' token
   44 |          ans="No"
      |                  ^
      |                  ;
   45 |        }else if(b<c){
      |        ~          
a.cc:58:15: error: lvalue required as left operand of assignment
   58 |        if(a==0&&b=0){
      |           ~~~~^~~
a.cc:59:18: error: expected ';' before '}' token
   59 |          ans="No"
      |                  ^
      |                  ;
   60 |        }else if(a<b){
      |        ~          
a.cc:71:15: error: lvalue required as left operand of assignment
   71 |        if(a==0&&c=0){
      |           ~~~~^~~
a.cc:72:18: error: expected ';' before '}' token
   72 |          ans="No"
      |                  ^
      |                  ;
   73 |        }else if(a<c){
      |        ~          
a.cc:84:15: error: lvalue required as left operand of assignment
   84 |        if(b==0&&c=0){
      |           ~~~~^~~
a.cc:85:18: error: expected ';' before '}' token
   85 |          ans="No"
      |                  ^
      |                  ;
   86 |        }else if(b<c){
      |        ~