#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll tenta(ll a, ll b, ll n, bool x) {
  ll answer = 0;
  while (a <= n && b <= n) {
    if (x)
      a += b;
    else
      b += a;
    x = !x;
    answer++;
  }
  return answer;
}
void test_case() {
  ll a, b, n;
  cin >> a >> b >> n;
  ll answer = min(tenta(a, b, n, false), tenta(a, b, n, true));
  cout << answer << "\n";
}
int main() {
  ios::sync_with_stdio(false);
  ll tc;
  cin >> tc;
  while (tc--) {
    test_case();
  }
  return 0;
}
