#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
const long long int N = 100005;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t;
  cin >> t;
  while (t--) {
    long long int i, j, k, n, m, ans = 0, cnt = 0, sum = 0, a, b, c = 0;
    cin >> a >> b >> n;
    long long int tp = a;
    a = max(tp, b);
    b = min(tp, b);
    while (a <= n && b <= n) {
      tp = a;
      b += a;
      a = b;
      b = tp;
      c++;
    }
    cout << c << '\n';
  }
  return 0;
}
