Strange String Manipulation

아직 제출이 없습니다시간 제한8초메모리 제한512 MB

문제

A linear congruential generator produces a series R()R(·) of pseudo-random numbers by the following formulas:

R(0)=SR(0) = S, R(i)=(AR(i1)+C)modMR(i) = (A · R(i - 1) + C) \bmod M (for i=1,2,i = 1, 2, \dots),

where SS, AA, CC, and MM are all parameters. In this problem, 0S,A,C150 \le S, A, C \le 15 and M=256M = 256.

Now suppose we have some input string I()I(·), where each character in the string is an integer between 00 and (M1)(M - 1). Then, using the pseudo-random number series R()R(·), we obtain another string O()O(·) as the output by the following formula:

O(i)=(I(i)+R(i))modMO(i) = (I(i) + R(i)) \bmod M (for i=1,2,i = 1, 2, \dots),

Your task is to write a program that shows the parameters SS, AA, and CC such that the information entropy of the output string O()O(·) is minimized. Here, the information entropy HH is given by the following formula:

H = -\sum\_{x}{\frac{\text{#}(x)}{N}\log{\frac{\text{#}(x)}{N}} }

where NN is the length of the string and \text{#}(x) is the number of occurences of the alphabet xx.

입력

The input has the following format:

NN

I(1)I(2) I(N)I(1) I(2) \dots I(N)

NN does not exceed 256.

출력

Print in a line the values of the three parameters SS, AA, and CC separated by a single space. If more than one solution gives the same minimum entropy, choose the solution with the smallest SS, AA, and then CC.