#include <bits/stdc++.h>
#define INT long long int
using namespace std;

char infile[100], outfile[100];

int main() {
    ios::sync_with_stdio(false);
    INT T,a[4], b, n, t, i, I,a1,b1;
    cin >> T;
    for(I=1;I<=T;I++){
        sprintf(infile, ".%d.in", I);
        freopen(infile, "w", stdout);
        a[0]=(rand()*100LL+rand())%10+1;
        a[1]=(rand()*100LL+rand())%100+1;
        a[2]=(rand()*1000000LL+rand()*rand()+rand()*10000LL+rand())%1000000000+1;
        if(a[0]<0) a[0]*-1;
        if(a[1]<0) a[1]*-1;
        if(a[2]<0) a[2]*-1;
        sort(a,a+3);
        a1 = a[0];
        b1 = a[1];
        n = a[2];
        printf("%lld %lld %lld\n", a1,b1, n);
        sprintf(outfile, ".%d.out", I);
        freopen(outfile, "w", stdout);
        INT ans = 0;
        while (max(a1, b1) <= n) {
          if (a1 > b1) {
            b1 += a1;
          } else {
            a1 += b1;
          }
          ++ans;
        }
        printf("%lld\n",ans);
      }

}

