#includeusing namespace std;int main(){ int n,a[110],j,i; cin>>n; for (i=1;i<=n;i++)</span> cin>>a[i]; for (i=1;i<=n;i++)</span> if (a[i]!=a[n-i+1]) goto l1; cout<<0;return 0;</span> l1:for (i=1;i<=n;i++)</span> { for (j=i;j<=n;j++)</span> if (a[j]!=a[n-j+i]) goto l; cout<<i-1<<<span>'\n'; for (j=i-1;j>=1;j--) cout<<a[j]<<' ';</span> return 0; l:; }}