#include<bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<n;++i)
int main(){
  string r, a;
  while(cin>>r>>a, r!="0"){
    int h = 0, b = 0;
    REP(i, 4) REP(j, 4){
      if(r[i] == a[j]){
        if(i == j) h++;
        else b++;
      }
    }
    cout<<h<<" "<<b<<endl;
  }
  return 0;
}