#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
const int inf = 1e9 + 5;
const int mod = 1e9 + 7;
const int logN = 17;
int n, m, k, x, y, z, a, b, t;
int main() {
  scanf("%d", &t);
  for (int i = 1; i <= t; i++) {
    scanf("%d %d %d", &a, &b, &n);
    int s = 0;
    while (a <= n && b <= n) {
      if (a < b) swap(a, b);
      b += a;
      s++;
    }
    cout << s << endl;
  }
  return 0;
}
