#include<iostream>
#include<string>
#include<map>
using namespace std;

int main(int argc, char *argv[]){
  string r, a;
  while(std::cin >> r >> a){
    if(r == "0")break;
    int n = r.size();
    map<char, int> hash;
    for (int i = 0; i < n; i++) {
      hash[r[i]] = i;
    }
    int hit = 0, blow = 0;
    for (int i = 0; i < n; i++) {
      if(a[i] == r[i]){
        hit++;
        continue;
      }
      if(hash.count(a[i]) == 1){
        blow++;
      }
    }
    std::cout << hit << " " << blow << std::endl;
  }
  return 0;
}