#include <iostream>
using namespace std;

int main()
{
  string r, a;
  int c1, c2;

  while (cin >> r >> a && r != "0"){
    c1 = c2 = 0;
    for (int i = 0; i < 4; i++){
      if (r[i] == a[i]){
        c1++;
      }
    }
    for (int i = 0; i < 4; i++){
      for (int j = 0; j < 4; j++){
        if (r[i] == a[j] && i != j){
          c2++;
        }
      }
    }

    cout << c1 << " " << c2 << endl;
  }
}