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