#include <iostream>
#define rep2(x,from,to) for(int x=(from);(x)<(to);(x)++)
#define rep(x,to) rep2(x,0,to)
using namespace std;
int main(){
	int a, b;
	while(cin >> a >> b, (a || b)) {
		int hit=0, blow=0;
		int ma[4],mb[4];
		rep(i,4) {
			ma[i] = a%10, mb[i] = b%10;
			a/=10, b/=10;
		}
		rep(i,4) {
			if(ma[i]==mb[i]) {
				hit++;
				mb[i] = -1;
			}
		}
		rep(i,4) {
			if(ma[i]!=mb[i]) {
				rep(j,4) {
					if(ma[i] == mb[j]) {
						blow++;
						mb[j] = -1;
					}
				}
			}
		}
		cout << hit << " " << blow << endl;
	}
}