#include<iostream>
#include<string>
#include<cstdio>
using namespace std;
 
#define rep(i,x) for(int i=0;i<x;i++)
 
int main(){
	while(1){
		string s,t;
		cin>>s>>t; if(s=="0"&&t=="0")break;
		int r[5],a[5];
		rep(i,4){
			r[i]=s[i]-48;
			a[i]=t[i]-48;
		}
		int c=0,d=0;
		rep(i,4){
			if(r[i]==a[i])c++;
			else {
				rep(j,4)if(r[i]==a[j])d++;
			}
		}
 
		printf("%d %d\n",c,d);
	}
}