#include <bits/stdc++.h>
using namespace std;
long long numbit(long long x) { return (1LL << x) - 1LL; }
long long getbit(long long x, long long i) { return (x >> i) & 1LL; }
long long onbit(long long x, long long i) { return x | (1LL << i); }
long long offbit(long long x, long long i) { return x & (~(1LL << i)); }
const int oo = 1000111000;
const int Nmax = 1e5 + 10;
const long long mod = 1e9 + 7;
const long double PI = 3.14159265358979323846;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  int e;
  cin >> e;
  for (long long z = (1); z <= (e); z++) {
    long long x, y, n;
    cin >> x >> y >> n;
    if (x > y) swap(x, y);
    long long r = 0;
    while (y <= n) {
      long long z = (x + y);
      x = y;
      y = z;
      r++;
    }
    cout << r << endl;
  }
}
