#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < n; i++)

int main() {
    string a, b;
    while(1){
        cin >> a >> b;
        if(a=="0")break;
        int hit=0, blow=0;
        REP(i,4){
            if(a[i]==b[i])hit++;
        }
        REP(i,4)REP(j,4){
            if(i==j)continue;
            if(a[i]==b[j])blow++;
        }
        cout << hit << " " << blow << endl;
    }
    return 0;
}

