#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5, mod = 1e9 + 7;
int T, n, m, x, y, z, p, fl, ans, t, w, l, r, xx, yy, a[N], b[N], f[N];
char s[N];
long long qpow(long long a, int b) {
  long long ans = 1;
  for (; b; b >>= 1, a = a * a % mod)
    if (b & 1) ans = ans * a % mod;
  return ans;
}
int main() {
  scanf("%d", &T);
  while (T--) {
    int fl = 1;
    scanf("%d%d%d", &x, &y, &z);
    if (x > y) swap(x, y);
    int t = x + y, cnt = 1;
    for (; t <= z;) {
      y = y + t, swap(y, t), cnt++;
    }
    printf("%d\n", cnt);
  }
  return 0;
}
