#include <iostream>
#include <math.h>
using namespace std;

int main() {
  char r[4], a[4];
  int h, b;

  while(1) {
    cin >> r >> a;
    if(r[0] == '0' && a[0] == '0') break;

    h = 0;
    b = 0;

    for(int i = 0 ; i < 4; i++){
      if(r[i] == a[i])
        h++;
    }

    for(int i = 0 ; i < 4; i++) {
      for(int j = 0; j < 4; j++) {
        if(r[i] == a[j])
          b++;
      }
    }

  cout << h << ' ' << (b-h) << endl;
  }
  return 0;
}

