#include using namespace std; string comb (char a, char b){ if(a=='A' && (b=='A' || b== 'O') || ((a== 'O') && (b== 'A'))) return "A"; if((a=='A' && b=='B') || (a=='B' && b =='A')) return "AB"; if(a=='B' && (b=='B' || b=='O') || ((a=='O') &&(b=='B'))) return "B"; if(a=='O' && b=='O') return "O"; else return ""; } int main(){ string s,t; cin>>s>>t; // Initialize the count variables int ca = 0, cb = 0, cab = 0, co = 0; // saare ko hi krna hai initialise, wo equal krdena tha ye to // Loop through each character in the strings for (int i = 0; i < s.size(); i++) { for (int j = 0; j < t.size(); j++) { string result = comb(s[i], t[j]); // Store the result of comb function if (result == "A") ca++; else if (result == "B") cb++; else if (result == "AB") cab++; else if (result == "O") co++; } } // Calculate the probabilities in percentages cout << ca * 25 << " " << cb * 25 << " " << cab * 25 << " " << co * 25; return 0; }