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