#include <bits/stdc++.h>
using namespace std;
void basEkBaarAur() {
  long long int a, b, n;
  cin >> a >> b >> n;
  if (a < b) swap(a, b);
  if (a > n)
    cout << 0;
  else {
    long long int sum = a + b;
    long long int cnt = 1, t;
    while (sum <= n) {
      t = sum;
      sum += a;
      a = t;
      cnt++;
    }
    cout << cnt;
  }
}
signed main() {
  cout << fixed << setprecision(15);
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int TESTS = 1;
  cin >> TESTS;
  while (TESTS--) {
    basEkBaarAur();
    cout << endl;
  }
  cerr << endl << "समय गुज़रा : " << 1.0 * clock() / CLOCKS_PER_SEC << endl;
  return 0;
}
