#include <bits/stdc++.h>
using namespace std;
const long long INF64 = 1e18;
clock_t time_p = clock();
void time() {
  time_p = clock() - time_p;
  cerr << "Time Taken : " << (float)(time_p) / CLOCKS_PER_SEC << "\n";
}
void doc() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
bool isprime(long long n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
long long n, a, b;
long long yo(long long a, long long b) {
  if (a > n and b > n) return 0;
  if (a < b) swap(a, b);
  return 1 + yo(a, a + b);
}
void solve() {
  long long ans = 0;
  cin >> a >> b >> n;
  if (a < b) swap(a, b);
  cout << yo(a, b) - 1 << '\n';
}
int main() {
  fast();
  int t;
  cin >> t;
  while (t--) solve();
}
