#include<iostream>
#include<cmath>
using namespace std;
   
int main()
{
    int num1[3], num2[3],sum[3];
 
    for(int i = 0;i < 3;i++)
   {
       cin >> num1[i] >> num2[i];
       sum[i] = num1[i] >> num2[i];
   }


    for(int i = 0;i < 3;i++)
    {
       int n = 1;
   
       while (true)
       {
           int po = pow(10, n);
           if (!((sum % po) == sum))
               n++;
           else
               break;
       }
        cout << n << endl;
     }
}