// https://www.geeksforgeeks.org/find-first-repeating-element-array-integers/
#include <iostream>
#include <set>
using namespace std;
int repeat (int a[], int n) {
int min = -1;
set <int> s;
for (int i=n-1;i>=0;i--){
if (s.find(a[i]) != s.end())
min = i;
else
s.insert(a[i]);
}
return min;
}
int main(){
int n;
cin>>n;
int a[n];
for (int i=0;i<n;i++)
cin>>a[i];
int j= repeat(a,n);
if (j != -1)
cout << "Repeating element is: " << a[j];
else
cout << "There is no repeating element.";
}