#include<iostream>
#include<string>
using namespace std;
int main() {
	string n, m;
	while (cin >> n >> m&&n != "0"&&m != "0") {
		int h = 0, b = 0;
		bool w[4];
		fill(w, w + 4, false);
		for (int i = 0; i < 4; i++) {
			if (n[i] == m[i]) {
				h++;
				w[i] = true;
			}
		}
		for (int i = 0; i < 4; i++) {
			if (!w[i]) {
				for (int j = 0; j < 4; j++) {
					if (!w[i] && n[i] == m[j])
						b++;
				}
			}
		}
		cout << h << " " << b << endl;
	}
}