#include <bits/stdc++.h>
using namespace std;
const double PI = 3.1415926535897;
const int mod = 1000000007;
const int M = 100005;
int INF = INT_MAX;
int solve() {
  long long a, b, n;
  cin >> a >> b >> n;
  int i = 0;
  long long t = min(a, b);
  b = max(a, b);
  a = t;
  while (b <= n) {
    t = a + b;
    a = b;
    b = t;
    i++;
  }
  cout << i << "\n";
  return 0;
}
int main() {
  cin.sync_with_stdio(false);
  int t, i = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
