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