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