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