#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long MOD2 = 998244353;
const float pi = 3.141592653;
void solve() {
  long long a, b, n;
  cin >> a >> b >> n;
  long long mini = min(a, b), maxi = max(a, b);
  long long count = 0;
  while (1) {
    if (maxi > n) break;
    count++;
    long long e = mini + maxi;
    mini = maxi;
    maxi = e;
  }
  cout << count;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  cin >> t;
  while (t--) {
    solve();
    cout << "\n";
  }
  return 0;
}
