#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int a, b;
    cin >> a >> b;
    int n;
    cin >> n;
    if (a < b) {
      int t = a;
      a = b;
      b = t;
    }
    int s = 0;
    int c = 0, i = 1;
    while (b <= n && a <= n) {
      c++;
      if (i % 2) {
        b += a;
      } else {
        a += b;
      }
      i++;
    }
    cout << c << endl;
  }
}
