For this Question: A child is running up a staircase with n steps and can hop either 1 step, 2 steps or 3 steps at a time. Implement a method to count how many possible ways the child can run-up to the stairs. You need to return all possible number of ways.
The time complexity of your code should be O(n).
Print answer modulo 10^9 + 7.The input line contains T, denoting the number of testcases.  Each testcase contains single line containing N, i.e. stairs having number of steps.  

Constraints
1 <= T <= 10
1 <= N <= 10^5Find the total number of ways. Since the answer can be very large, thus print them as modulo 10^9 + 7.Sample Input
2
4
3

Sample output
7
4

Explanation:
Testcase 1:
In this case we have stairs with 4 steps. So we can figure out how many ways are there to reach at the top.
1st: (1, 1, 1, 1)
2nd: (1, 1, 2)
3rd: (1, 2, 1)
4th: (1, 3)
5th: (2, 1, 1)
6th:  (2, 2)
7th: (3, 1), I have written this Solution Code: 
dp = [1,2,4]

n = int(input())
for i in range(n):
	k=int(input())
	one = 1
	two = 2
	three = 4
	four = 0
	if k<4:
		print(dp[k-1])
		continue
	for i in range(3,k):
		four = one + two + three
		one = two
		two = three
		three = four
	print(four%(10**9+7)), In this Programming Language: Python, Now tell me if this Code is compilable or not?