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