#include <bits/stdc++.h>
using namespace std;
#define TLHAdepzais1tg ios_base::sync_with_stdio(0);cin.tie();cout.tie(0);
#define ll long long
#define N 1000007
#define fi first
#define se second
#define pii pair<ll,ll>
#define str string
ll a,b,n;
int t;
int main()
{
    TLHAdepzais1tg;
    if(fopen("plusplus.inp","r"))
    {
        freopen("plusplus.inp","r",stdin);
        freopen("plusplus.out","w",stdout);
    }
    cin>>t;
    while(t--)
    {
        int cnt=0;
        cin>>a>>b>>n;
        if(a>b)
            swap(a,b);
        while(a<=n&&b<=n)
        {
            ll res=a+b;
            if(a<b)
            {
                a=res;
                cnt++;
            }
            else{
                b=res;
                cnt++;
            }
        }
        cout<<cnt<<'\n';
    }
    return 0;
}
