#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  srand(chrono::high_resolution_clock::now().time_since_epoch().count());
  long long t, a, b, n;
  cin >> t;
  for (int i = 0; i < t; i++) {
    long long count = 0;
    cin >> a >> b >> n;
    while (!(a > n || b > n)) {
      if (a <= b) {
        a += b;
      } else {
        b += a;
      }
      count++;
    }
    cout << count << endl;
  }
  return 0;
}
