#include <bits/stdc++.h>
using namespace std;
template <typename S, typename T>
ostream& operator<<(ostream& out, pair<S, T> const& p) {
  out << '(' << p.first << ", " << p.second << ')';
  return out;
}
template <typename T>
ostream& operator<<(ostream& out, vector<T> const& v) {
  int l = v.size();
  for (int i = 0; i < l - 1; i++) out << v[i] << ' ';
  if (l > 0) out << v[l - 1];
  return out;
}
template <typename T>
void trace(const char* name, T&& arg1) {
  cout << name << " : " << arg1 << endl;
}
template <typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : " << arg1 << " | ";
  trace(comma + 1, args...);
}
int main() {
  clock_t tStart = clock();
  int test;
  test = 1;
  cin >> test;
  while (test--) {
    long long a, b, n;
    cin >> a >> b >> n;
    long long x1 = min(a, b);
    long long x2 = max(a, b);
    long long op = 0;
    while (max(x1, x2) <= n) {
      if (op % 2 == 0) {
        x1 += x2;
      } else {
        x2 += x1;
      }
      op++;
    }
    cout << op << endl;
  }
  return 0;
}
