#include <bits/stdc++.h>
int main() {
  int T, t, a, b, n, k, temp;
  scanf("%d", &T);
  for (t = 0; t < T; t++) {
    scanf("%d%d%d", &a, &b, &n);
    k = 0;
    while (a <= n) {
      if (a > b) {
        temp = a;
        a = b;
        b = temp;
      }
      a += b;
      k++;
    }
    printf("%d\n", k);
  }
  return 0;
}
