#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2")
using namespace std;
using lld = long long int;
using pll = pair<lld, lld>;
using lf = float;
using pff = pair<lf, lf>;
using pii = pair<int, int>;
int n, m;
lld cal(lld p, lld q, lld r) {
  int type = 0;
  int cnt = 0;
  while (p <= r && q <= r) {
    if (type == 0)
      p += q;
    else
      q += p;
    type ^= 1;
    cnt++;
  }
  return cnt;
}
int main() {
  int i, j, k;
  int t = 1, tv = 0;
  scanf("%d", &t);
  while (t--) {
    lld p, q, r;
    scanf("%lld %lld %lld", &p, &q, &r);
    lld s = cal(p, q, r);
    lld t = cal(q, p, r);
    printf("%lld\n", min(s, t));
  }
}
