#include<iostream>
using namespace std;
int main() {
	char a[5];
	char b[5];
	int x;
	int hit[12001];
	int blow[12001];
	for (int i = 0;; i++){
		cin >> a >> b;
		hit[i] = 0;
		blow[i] = 0;
		if (a[0] == '0' && b[0] == '0'){
			x = i;
			break;
		}
		for (int j = 0; j < 4; j++){
			for (int k = 0; k < 4; k++){
				if (a[j] == b[k]){
					if (j == k){
						hit[i] += 1;
					}
					else blow[i] += 1;
				}
			}
		}
	}
	for (int i = 0; i < x; i++){
		cout << hit[i] << " " << blow[i] << endl;
	}
}