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