#include <bits/stdc++.h>
int main() {
  long long int i, t, count = 0, n, a, b;
  scanf("%lld", &t);
  for (i = 1; i <= t; i++) {
    scanf("%lld%lld%lld", &a, &b, &n);
    while ((a <= n) || (b <= n)) {
      if (a < b) {
        a = a + b;
        count = count + 1;
      } else {
        b = b + a;
        count = count + 1;
      }
    }
    printf("%lld\n", count - 1);
    count = 0;
  }
  return 0;
}
