#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin.sync_with_stdio(0);
  int t;
  cin >> t;
  while (t--) {
    int a, b, n, ans = 0;
    cin >> a >> b >> n;
    while (a <= n && b <= n) {
      if (a > b)
        b += a;
      else
        a += b;
      ans++;
    }
    cout << ans << endl;
  }
}
