function permute(permutation) {
  var length = permutation.length,
      result = [permutation.slice()],
      c = new Array(length).fill(0),
      i = 1, k, p;

  while (i < length) {
    if (c[i] < i) {
      k = i % 2 && c[i];
      p = permutation[i];
      permutation[i] = permutation[k];
      permutation[k] = p;
      ++c[i];
      i = 1;
      result.push(permutation.slice());
    } else {
      c[i] = 0;
      ++i;
    }
  }
  return result;
}

var allArr=[0];
for(var i=0;i<10;i++){
   var arr=[];
   for(var j=0;j<i+1;j++)arr.push(j);
   allArr[i+1]=permute(arr);
}

var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var arr= input.trim().split("\n") ;
while(true){
   var n=arr.shift()-0;
   if(n==0)break;
}
console.log("");
