Once upon a time in a kingdom far, far away, there lived eight princes. Sadly they were on very bad terms so they began to quarrel every time they met.

One day, the princes needed to seat at the same round table as a party was held. Since they were always in bad mood, a quarrel would begin whenever:

* A prince took the seat next to another prince.
* A prince took the seat opposite to that of another prince (this happens only when the table has an even number of seats), since they would give malignant looks each other.



Therefore the seat each prince would seat was needed to be carefully determined in order to avoid their quarrels. You are required to, given the number of the seats, count the number of ways to have all eight princes seat in peace.



Input

Each line in the input contains single integer value N , which represents the number of seats on the round table. A single zero terminates the input.

Output

For each input N , output the number of possible ways to have all princes take their seat without causing any quarrels. Mirrored or rotated placements must be counted as different.

You may assume that the output value does not exceed 1014.

Example

Input

8
16
17
0


Output

0
0
685440
#include <bits/stdc++.h>
#define int long long
using namespace std;


int ODD(int n){

  int dp[202][9][2][2];
  
  memset(dp,0,sizeof(dp));
  
  dp[0][0][0][0]=1;
  dp[0][1][1][1]=1;
  
  for(int i=0;i<n;i++){
    for(int j=0;j<9;j++){
      for(int k=0;k<2;k++){
	for(int l=0;l<2;l++){
	  if(j<8&&k==0) dp[i+1][j+1][1][l] += dp[i][j][k][l];
	  dp[i+1][j][0][l] += dp[i][j][k][l];
	}
      }
    }
  }
  return (dp[n-1][8][0][1] + dp[n-1][8][0][0] + dp[n-1][8][1][0])*40320;
}

int EVEN(int n){

  n>>=1;

  int dp[202][9][3][3];
  
  memset(dp,0,sizeof(dp));
  
  dp[0][0][0][0]=1;
  dp[0][1][1][1]=1;
  dp[0][1][2][2]=1;
  
  for(int i=0;i<n;i++){
    for(int j=0;j<9;j++){
      for(int k=0;k<3;k++){
	for(int l=0;l<3;l++){
	  if(j<8&&k==0){
	    dp[i+1][j+1][1][l] += dp[i][j][k][l];
	    dp[i+1][j+1][2][l] += dp[i][j][k][l];
	  }
	  else if(j<8&&k==1){
	    dp[i+1][j+1][2][l] += dp[i][j][k][l];
	  }
	  else if(j<8&&k==2){
	    dp[i+1][j+1][1][l] += dp[i][j][k][l];
	  }
	  dp[i+1][j][0][l] += dp[i][j][k][l];
	}
      }
    }
  }
  return (dp[n-1][8][0][0] + dp[n-1][8][1][0] + dp[n-1][8][2][0] + dp[n-1][8][0][1] + dp[n-1][8][1][1] + dp[n-1][8][0][2] + dp[n-1][8][2][2] )*40320;
  
}

signed  main(){
  int n;
  while(cin>>n,n){
    if(n%2)cout<<ODD(n)<<endl;
    else cout<<EVEN(n)<<endl;
  }
}
