#include <bits/stdc++.h>
using namespace std;
int main() {
  ;
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int t;
  cin >> t;
  while (t--) {
    long long a, b, c;
    cin >> a >> b >> c;
    long long cnt = 0;
    while (1) {
      if (a > c || b > c) break;
      if (a > b) {
        b += a;
      } else
        a += b;
      cnt++;
    }
    cout << cnt << endl;
  }
}
