#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int ans[n];
  for (int i = 0; i < n; i++) {
    int a, b, z;
    bool k = true;
    cin >> a >> b >> z;
    ans[i] = 0;
    if (a > b) {
      k = false;
    }
    while (a <= z && b <= z) {
      if (k) {
        a += b;
        k = false;
      } else {
        b += a;
        k = true;
      }
      ans[i]++;
    }
  }
  for (int i = 0; i < n; i++) {
    cout << ans[i] << endl;
  }
  return 0;
}
