#include <bits/stdc++.h>
using namespace std;
bool comp(pair<char, int> a, pair<char, int> b) {
  return (a.second > b.second);
}
vector<int> factors(int n) {
  vector<int> v;
  for (int i = 1; i <= sqrt(n); i++) {
    if (n % i == 0) {
      if (n / i == i)
        v.push_back(i);
      else {
        v.push_back(i);
        v.push_back(n / i);
      }
    }
  }
  return v;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    long a, b, n;
    cin >> a >> b >> n;
    if (a < b) swap(a, b);
    long ctr = 0;
    if (a > n) {
      cout << 0 << endl;
      continue;
    }
    while (true) {
      if (a > b) {
        b += a;
        ctr++;
        if (b > n) break;
        a += b;
        ctr++;
        if (a > n) break;
      } else {
        a += b;
        ctr++;
        if (a > n) break;
        b += a;
        ctr++;
        if (b > n) break;
      }
    }
    cout << ctr << endl;
  }
  return 0;
}
