Stupid Sequence

A stupid sequence is a sequence generated by a function defined by a polynomial as shown below: f(x)=a0 +a1x+a2x2 +a3x3 +a4x4 +a5x5 +a6x6 So the stupid sequence is actually f(1),f(2),f(3),f(4)... Youcanassumethatforalli(0≤i≤6),0≤ai ≤1000. In this problem you will be given the first 1500 terms of stupid sequence, and you will have to find the values of a0,a1,a2,a3,a4,a5,a6. Input First line of the input file contains an integer N (0 < N < 101) which denotes the total number of input set. The description of each set is given below: Each set contains 1500 lines of inputs. Each line contains a single integer. The i-th line of a set denotes the i-th element of a stupid sequence. All these integers fit in 64-bit unsigned integer. There is a blank line after the input of each set. Output For each set of input produce one line of output. This line contains the values of a0,a1,a2,a3,a4,a5,a6. All these values are non-negative and less than 1001. If such values are not found print a line ‘This is a smart sequence!’ instead. Note: As the sample input is too to include here, we write just the first 10 elements of sample cases. Sample Input 3 1 1 1 1 1 1 1 1 1 1 ... 2 6 12 20 30 42 56 72

2/2 90 110 ... 1 64 729 4096 15625 46656 117649 250000 500000 1000000 ... Sample Output 1000000 0110000 This is a smart sequence!