#include <bits/stdc++.h>
using namespace std;
void func(int a, int b, int n) {
  int cnt = 0;
  while (a <= n && b <= n) {
    if (b > a)
      a += b;
    else
      b += a;
    cnt++;
  }
  cout << cnt << endl;
}
int main() {
  int a, b, n, t;
  cin >> t;
  while (t != 0) {
    cin >> a >> b >> n;
    func(a, b, n);
    t--;
  }
}
