1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#include <cstdio>

int main ()
{
  int n, z = 0;
  scanf ("%i ", &n);
  for (int i=0; i<n*8; i++) z += getchar () == '0';
  if (z<n*2 || z>n*5) printf ("NIE");
  else for (; n>0; z-=z/n--) putchar ("wntpouea" [z/n-2 + n%2*4]);
  puts ("");
  return 0;
}