#include <bits/stdc++.h>
using namespace std;
const double pi = 3.14159265359;
int main() {
  int t;
  long long a, b, n, ans;
  cin >> t;
  while (t--) {
    cin >> a >> b >> n;
    ans = 0;
    if (a > n || b > n) {
      cout << 0 << endl;
      continue;
    }
    while (1) {
      ans++;
      if (a > b)
        b += a;
      else
        a += b;
      if (a > n || b > n) break;
    }
    cout << ans << endl;
  }
  return 0;
}
