#include <bits/stdc++.h>
using namespace std;
void test_case() {
  int a, b, n;
  cin >> a >> b >> n;
  int count = 0;
  while (a <= n && b <= n) {
    if (a < b) {
      a += b;
    } else {
      b += a;
    }
    count++;
  }
  cout << count << "\n";
}
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    test_case();
  }
}
