#include <bits/stdc++.h>
using namespace std;
const long long N = 1e6 + 5, Mod = 1e9 + 7;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long t;
  cin >> t;
  while (t--) {
    long long a, b, n;
    cin >> a >> b >> n;
    if (a > n || b > n)
      cout << "0\n";
    else {
      long long x = 0;
      while (a <= n && b <= n) {
        if (a < b) {
          a += b;
        } else {
          b += a;
        }
        x++;
      }
      cout << x << '\n';
    }
  }
  return 0;
}
