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
#include <iostream>
#include <vector>

using namespace std;

int main()
{
	int n;
	cin >> n;
	vector<long long> data;
	for(int i=0;i<n;i++)
	{
		long long l;
		cin >> l;
		data.push_back(l);
	}
	
	for(int i=1;i<n;i++)
		for(int j=0;j<n-i;j++)
			if(data[j+i]-data[j]>data[i-1])
			{
				cout << "NIE" << endl;
				return 0;
			}
	cout << "TAK" << endl << n << endl;
	
	long long suma = 0;
	for(int i=0;i<n;i++)
	{
		cout << data[i] - suma << " ";
		suma += data[i] - suma;
	}
	cout << endl;
	return 0;
}