#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long int a, b, n, x, y, i = 0;
    cin >> a >> b >> n;
    for (i = 0; i < 10000; i++) {
      if (a > n || b > n) {
        break;
      }
      x = min(a, b);
      y = max(a, b);
      x = x + y;
      a = y;
      b = x;
    }
    cout << i << '\n';
  }
}
