#include <bits/stdc++.h>
using namespace std;
long long cost = 1e18;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long int t;
  cin >> t;
  while (t--) {
    long long int a, b, n, cnt = 0;
    cin >> a >> b >> n;
    while (max(a, b) <= n) {
      if (a < b) {
        a += b;
      } else {
        b += a;
      }
      cnt++;
    }
    cout << cnt << "\n";
  }
  return 0;
}
