#include <bits/stdc++.h>
using namespace std;
const int M = 1e9 + 7;
const int N = 2e5 + 1;
const int oo = 1e9;
const double pi = acos(-1);
int main() {
  int t;
  cin >> t;
  while (t--) {
    int a, b, n;
    cin >> a >> b >> n;
    if (b < a) swap(a, b);
    int ans = 0;
    while (a <= n && b <= n) {
      ++ans;
      if (ans % 2)
        a += b;
      else
        b += a;
    }
    cout << ans << endl;
  }
  return 0;
}
