#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t, a, b, n;
  scanf("%lld", &t);
  while (t--) {
    long long int cn = 0;
    scanf("%lld", &a);
    scanf("%lld", &b);
    scanf("%lld", &n);
    if (b > a) {
      long long int tm = a;
      a = b;
      b = tm;
    }
    while (1) {
      if (a > n || b > n) break;
      if (cn % 2)
        a = a + b;
      else
        b = b + a;
      cn++;
    }
    cout << cn << '\n';
  }
}
