Leo has developed a new programming language C+=. In C+=, integer variables can only be changed with a "+=" operation that adds the right-hand side value to the left-hand side variable. For example, performing "a += b" when a = 2, b = 3 changes the value of a to 5 (the value of b does not change).

In a prototype program Leo has two integer variables a and b, initialized with some positive values. He can perform any number of operations "a += b" or "b += a". Leo wants to test handling large integers, so he wants to make the value of either a or b strictly greater than a given value n. What is the smallest number of operations he has to perform?

Input

The first line contains a single integer T (1 ≤ T ≤ 100) — the number of test cases.

Each of the following T lines describes a single test case, and contains three integers a, b, n (1 ≤ a, b ≤ n ≤ 10^9) — initial values of a and b, and the value one of the variables has to exceed, respectively.

Output

For each test case print a single integer — the smallest number of operations needed. Separate answers with line breaks.

Example

Input


2
1 2 3
5 4 100


Output


2
7

Note

In the first case we cannot make a variable exceed 3 in one operation. One way of achieving this in two operations is to perform "b += a" twice.
import math 
import sys

sys.setrecursionlimit(10**4) 

def Divisors(n) : 
	
	l=[]
	i = 1
	while i <= math.sqrt(n): 
		
		if (n % i == 0) : 
			
			
			if (n // i == i) : 
				l.append(i)
			else : 
				l.append(i)
				l.append(n//i)
		i = i + 1
	return l

def SieveOfEratosthenes(n): 
	
	l=[]
	
	prime = [True for i in range(n+1)] 
	p = 2
	while (p * p <= n): 
		
		if (prime[p] == True): 
			
			for i in range(p * p, n+1, p): 
				prime[i] = False
		p += 1
	
	for p in range(2, n+1): 
		if prime[p]: 
			l.append(p)
	
	return l		

def primeFactors(n): 
	
	l=[]
	
	while n % 2 == 0: 
		l.append(2) 
		n = n / 2
		
	for i in range(3,int(math.sqrt(n))+1,2): 
		
		while n % i== 0: 
			l.append(i) 
			n = n / i 
			
	if n > 2: 
		l.append(n)
	
	return(l)	
		

def Factors(n) : 
	
	
	result = []
	
	for i in range(2,(int)(math.sqrt(n))+1) : 

		if (n % i == 0) : 
		    
			if (i == (n/i)) : 
				result.append(i)
			else : 
			    result.append(i)
			    result.append(n//i)
		
	result.append(1)
	result.append(n)
	return result

def maxSubArraySum(a): 
	
	max_so_far = 0
	max_ending_here = 0
	size=len(a)
	
	for i in range(0, size): 
		max_ending_here = max_ending_here + a[i] 
		if (max_so_far < max_ending_here): 
			max_so_far = max_ending_here 

		if max_ending_here < 0: 
			max_ending_here = 0
	return max_so_far 

#print(SieveOfEratosthenes(100))
#print(Divisors(100))
#print(primeFactors(100))
#print(Factors(100))
#print(maxSubArraySum(a)
def longestsubarray(arr, n, k): 
    current_count = 0
      
    # this will contain length of  
    # longest subarray found 
    max_count = 0
  
    for i in range(0, n, 1): 
        if (arr[i] % k != 0): 
            current_count += 1
        else: 
            current_count = 0
        max_count = max(current_count,  
                            max_count) 
      
    return max_count 
    
def main():

    
    a,b,n=list(map(int,input().split()))
    c=0
    if a>n or b>n:
        print(0)
    else:
        if b<a:
            c=a
            a=b
            b=c
        c=0    
        while (a<=n and b<=n):
            a+=b
            c+=1
            if a>n or b>n:
                print(c)
                break
            b+=a
            c+=1
            if a>n or b>n:
                print(c)
                break
    
    
t=int(input())
for i in range(0,t):
    main()


    