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