#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    ll a, b, n;
    cin >> a >> b >> n;
    ll cnt = 0;
    if (a > b) swap(a, b);
    while (max(a, b) <= n) {
      a += b;
      if (a > b) {
        swap(a, b);
      }
      cnt++;
    }
    cout << cnt << "\n";
  }
  return 0;
}
