#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int a, b, c, cnt = 0;
    cin >> a >> b >> c;
    while (a <= c && b <= c) {
      if (a > b)
        b += a;
      else
        a += b;
      cnt++;
    }
    cout << cnt << "\n";
  }
  return 0;
}
