Problem: Jack and Jill are sitting at the bottom of their tree house and debating in how many ways then can jump up the stairs on the tree and reach the tree house .Because Jack is older than Jill, He can jump one, two or three stairs in one step while Jill can jump just one or two stairs in one step .
For example, Jack can cover the 8 stairs by jumping (2,2,2,2) or (2,1,2,1,2) or other suitable combinations of steps.
Could you help them to find the total number of possibilities they have to reach the top.
Note that the order of the steps is important here, for example, (3,1) is treated distinct from (1,3)  i. e. jumping 3 stairs in first step followed by jumping 1 stair in other step is different from jumping one stair in first step and 3 stairs in second step.
Write a program to help them out 
Input:
 The number of stairs to be covered.
Output:
Number of total ways to reach to the top for Jack in the first line and Number of total ways to reach at the top for Jill in the second line.
(For other cases, output is ERROR)
Note: if total stairs to be covered are 3
Then, 
For jack total combinations are 4

1 1 1

1 2

2 1

3

For Jill total combinations are 3

1 1 1 

1 2

2 1

SAMPLE INPUT
3

SAMPLE OUTPUT
Jack-4
Jill-3

Solution (in PYTHON):

Solution:
def fa(a):
	
	factorial = 1
	if a == 0:
   		return 1;
	else:
   		for i in range(1,a + 1):
       			factorial = factorial*i
   	return factorial;
def f(a,b,c):
   ans=1;
   for i in range(a+b+c,max(a,b,c),-1):
	ans=ans*i;
   return ans/(fa(min(a,b,c))*fa(a+b+c-max(a,b,c)-min(a,b,c)));


n=int(raw_input());
if n<=0:
	print 'ERROR';
	exit();
p=2;
ans=1;
i=0;
j=0;
k=0;
while(n>=p):
	if n>p:
		i=n-p;
		j=p/2;
		k=0;
		ans=ans+f(i,j,k);
		#print i,j,k;
	if n==p:
		ans=ans+1;
		#print '0'+str(p/2)+'0';
	p=p+2;

y=ans;

p=3;
while n>=p:
	if n>p:
		t=n-p;
		#for t;
		tp=2;
		k=p/3;
		# for i 
		ans=ans+f(t,0,k);
		#print 'st'+str(t)+'0'+str(k);
		while(t>=tp):
			#print 't is '+str(t)+'tp is '+str(tp);
			if t>tp:
				i=t-tp;
				
			if t==tp:
				i=0;
			j=tp/2;
			tp=tp+2;
		        ans=ans+f(i,j,k);
			#print i,j,k;
	if n==p:
		ans=ans+1;
		#print '0 0'+str(p/3);
	p=p+3;
print 'Jack-'+str(ans);	
print 'Jill-'+str(y);