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

#define for_(i,a,b) for(int i=(a);i<(b);++i)

int main() {
	string a, b;
	
	while (cin >> a >> b) {
		if (a == "0") break;
		
		int hit = 0, blow = 0;
		
		for_(i,0,4) if (a.find(b[i]) != a.npos) ++blow;
		for_(i,0,4) if (a[i] == b[i]) { ++hit; --blow; }
		
		cout << hit << " " << blow << endl;
	}
}