#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long ll;
const int N=1e6+10;
int n,p[N],sum[N];ll a[N];char s[30];
inline void print(ll x){
if (!x) {putchar('0');putchar(' ');return;}
int l=0;for (;x;x/=10) s[l++]=x%10;
while (l--) putchar(s[l]+'0');
putchar(' ');
}
inline ll read(){
ll x=0;char ch=getchar();
while (ch>'9'||ch<'0') ch=getchar();
while (ch>='0'&&ch<='9') x=x*10-'0'+ch,ch=getchar();
return x;
}
int main()
{
freopen("A_long_name_without_mean.in","r",stdin);
freopen("A_long_name_without_mean.out","w",stdout);
scanf("%d",&n);
for (int i=1;i<=n;i++){
a[i]=read();
sum[i]=(a[i]%n+sum[i-1])%n;
if (p[sum[i]]){
for (int j=p[sum[i]]+1;j<=i;j++) print(a[j]);puts("");
return 0;
}
else p[sum[i]]=i;
}
puts("Tree in Tree with chairman tree.");
return 0;
}