def F(n): if n <= 7: return 5 return 3*F(n-4) + 14*F(n-7) def G(n): if n >= 3000: return 9 return 15*G(n-2) + 5 def H(n): if n >= 3000: return 9 return 15*H(n+2) + 5