#include <bits/stdc++.h>
using namespace std;
const long long INF = (1LL << 61) - 1;
const long long MOD = 1000000007;
const long long MAX_N = 500010;
long long a, b, c, d, e, f, h, x, y, z, p, q, n, t, r, k, w, l, ans, i, j, u, v;
string S, T;
vector<long long> A, B;
void input() { cin >> q; }
void solve() {
  cin >> a >> b >> c;
  ans = 0;
  while (a <= c && b <= c) {
    if (a > b) swap(a, b);
    a += b;
    ans++;
  }
  cout << ans << "\n";
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  input();
  while (q--) {
    solve();
  }
}
