#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t, a, b, n, big = 0, count = 0;
  cin >> t;
  while (t--) {
    cin >> a >> b >> n;
    for (;;) {
      big = max(a, b);
      if (big == a) {
        b = b + a;
      } else {
        a = a + b;
      }
      count++;
      if (a > n || b > n) {
        cout << count << "\n";
        break;
      }
    }
    count = 0, big = 0;
  }
  cerr << "[Execution : " << (1.0 * clock()) / CLOCKS_PER_SEC << "s]\n";
  return 0;
}
