#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long tt;
  cin >> tt;
  while (tt--) {
    long long a, b, c;
    cin >> a >> b >> c;
    long long ans = 0;
    if (a > b) swap(a, b);
    while (a <= c && b <= c) {
      ans++;
      long long t = b;
      b = a + b;
      a = t;
    }
    cout << ans << "\n";
  }
  return 0;
}
