#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5;
void solve() {
  long long a, b, n;
  cin >> a >> b >> n;
  long long cnt = 0;
  while (a <= n && b <= n) {
    if (a < b)
      a += b;
    else
      b += a;
    cnt++;
  }
  cout << cnt << endl;
}
int32_t main() {
  long long t;
  cin >> t;
  while (t--) {
    solve();
  }
}
