#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long int a, b, n;
    cin >> a >> b >> n;
    long long int cnt = 0;
    while (1) {
      if (b > a) {
        a += b;
        cnt++;
      } else {
        b += a;
        cnt++;
      }
      if (a > n || b > n) break;
    }
    cout << cnt << endl;
  }
  return 0;
}
