#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    long a, b, n;
    cin >> a >> b >> n;
    long c = 0;
    while (a <= n && b <= n) {
      c++;
      if (a > b) {
        b += a;
      } else {
        a += b;
      }
    }
    cout << c << endl;
  }
  return 0;
}
