#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long f[45];
  f[0] = 0, f[1] = 1;
  for (int i = 2; i < 45; i++) {
    f[i] = f[i - 1] + f[i - 2];
  }
  int t;
  cin >> t;
  for (int T = 0; T < t; T++) {
    long long a, b, n;
    cin >> a >> b >> n;
    if (b > a) {
      swap(a, b);
    }
    if (a > n || b > n) {
      cout << 0 << endl;
      continue;
    }
    for (int i = 0; i < 44; i++) {
      if (a * f[i + 1] + b * f[i] > n) {
        std::cout << i << std::endl;
        break;
      }
    }
  }
  return 0;
}
