1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <bits/stdc++.h>
using namespace std;
typedef long long lld;
typedef pair<int,int> pii;
typedef pair<lld,lld> pll;
typedef vector<int> vint;
#define ff first
#define ss second
#define mp make_pair
#define pb push_back

lld t[512];
lld k[512];
lld n,p;

int main(){
	scanf("%lld",&n);
	k[0]=0;
	for(int i=1;i<=n;++i){
		scanf("%lld",k+i);
		t[i]=k[i]-k[i-1];
		p=0;
		for(int j=i;j>0;--j){
			p+=t[j];
			if(p>k[i-j+1]){
				puts("NIE");
				exit(0);
			}
		}
	}
	puts("TAK");
	printf("%lld\n",n);
	for(int i=1;i<=n;++i){
		printf("%lld ",t[i]);
	}
	
	
	return 0;
}