Help me in solving RECUR05 problem

My issue

def fib(n):
write your code here
if n <= 0:
return “Invalid output”
elif n == 1:
return 1
elif n== 2:
return 1
elif n == 7:
return 1
else:
return fib(n-1) + fib(n-2) + fib(n-7)
n = int(input())
print(fib(n))

My code

def fib(n):
    #Write your code here
    if n <= 0:
        return "Invalid output"
    elif n == 1:
        return 1
    elif n== 2:
        return 1
    elif n == 7:
        return 1
    else:
        return fib(n-1) + fib(n-2) + fib(n-7)
n = int(input())
print(fib(n))

Learning course: Design and Analysis of Algorithms
Problem Link: https://www.codechef.com/learn/course/kl-daa/KLDAA2400D/problems/RECUR05