#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, a, b, i, ans;
  cin >> a >> b >> n;
  ans = 0;
  if (a < b) swap(a, b);
  for (i = 0;; i++) {
    if (i % 2)
      a += b;
    else
      b += a;
    ans++;
    if (a > n or b > n) break;
  }
  cout << ans << '\n';
}
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long tt;
  cin >> tt;
  while (tt--) {
    solve();
  }
  cerr << " Execution : " << (1.0 * clock()) / CLOCKS_PER_SEC << "s \n";
  return 0;
}
