#include <bits/stdc++.h>
using namespace std;
void solve() {
  int a, b, n, counter = 0, x = 0;
  cin >> a >> b >> n;
  if (a < b) swap(a, b);
  while (a <= n && b <= n) {
    if (x)
      a += b;
    else
      b += a;
    counter++;
    x ^= 1;
  }
  cout << counter << endl;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  int tc;
  cin >> tc;
  while (tc--) solve();
  return 0;
}
