#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long a, b, n;
    cin >> a >> b >> n;
    int counter = 0;
    while (a <= n && b <= n) {
      if (a >= b)
        b += a;
      else
        a += b;
      ++counter;
    }
    cout << counter << "\n";
  }
  return 0;
}
