#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
const long long N = 500005;
void solve() {
  long long a, b, n;
  cin >> a >> b >> n;
  if (a < b) swap(a, b);
  long long cnt = 0;
  while (a <= n && b <= n) {
    if (a > b)
      b = a + b;
    else
      a = a + b;
    cnt++;
  }
  cout << cnt << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
