#include<iostream>
#include<cstring>
#include<cstdlib>

using namespace std;

int main()
{
  while(true){
    char r1[5];
    char r2[5];
    scanf("%s%s", r1, r2);
    if(strcmp(r1,"0")==0&&strcmp(r2,"0")==0)break;
    
    int hit=0;
    int blow=0;
    for(int i = 0; i < 4; ++i){
      if(r1[i] == r2[i])++hit;
      for(int j = 0; j < 4; ++j){
	if(r1[i] == r2[j])++blow;
      }
    }
    blow -= hit;
    cout << hit << ' ' << blow << endl;
  }
  return 0;
}