#include #include #include #include #include using namespace std; int Tn; string s1, s2; int main(int argc, const char * argv[]) { cin >> Tn; assert(1 <= Tn && Tn <= 100); while (Tn--) { cin >> s1 >> s2; assert(s1.length() <= 100); assert(s1.length() == s2.length()); int n = (int)s1.length(); for(int i = 0; i < n; i++) { assert(s1[i] == '?' || (s1[i] >= 'a' && s1[i] <= 'z')); assert(s2[i] == '?' || (s2[i] >= 'a' && s2[i] <= 'z')); } /* If there is at least one question mark among a pair of compared symbols, then the second answer can be increased, while first one won't be changed. */ int ans1 = 0, ans2 = 0; for(int i = 0; i < n; i++) if (s1[i] == '?' || s2[i] == '?') { ++ans2; } else { ans1 += s1[i] != s2[i]; ans2 += s1[i] != s2[i]; } cout << ans1 << " " << ans2 << endl; } return 0; }