DO YOU EXPECT ME TO FIND THIS OUT?

WHAT BASE AND/XOR LANGUAGE INCLUDES string?

DON'T BYTE OF MORE THAN YOU CAN CHEW

YOU CAN ONLY DISTORT THE LARGEST OF MATHEMATICS SO FAR

SAYING "ABRACADABRA" WITHOUT A MAGIC AND WON'T DO YOU ANY GOOD

THE LAST STACK RUPTURES. ALL DIE. OH, THE EMBARRASSMENT!

I HAVE NO ARRAY AND I MUST SCREAM

ELEMENTS MAY NOT BE STORED IN WEST HYPERSPACE

Input

The first line of input data contains a single integer n (1 ≤ n ≤ 10).

The second line of input data contains n space-separated integers ai (1 ≤ ai ≤ 11).

Output

Output a single integer.

Example

Input

4
2 5 3 1


Output

4
#include <bits/stdc++.h>
using namespace std;
template <class T>
T abs(T a) {
  return a >= 0 ? a : -a;
}
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <class T>
T mod(T a, T b) {
  T ret = a % b;
  if (ret < 0) ret += b;
  return ret;
}
long long mulmod(long long a, long long b, long long c) {
  if (b == 0LL) return 0LL;
  long long ret = mulmod(a, b >> 1, c);
  ret = (ret + ret) % c;
  if (b & 1LL) ret = (ret + a) % c;
  return ret;
}
long long powmod(long long a, long long b, long long c) {
  if (b == 0LL) return 1LL;
  long long ret = powmod(a, b >> 1, c);
  ret = ret * ret % c;
  if (b & 1LL) ret = ret * a % c;
  return ret;
}
template <class T>
inline void wt(T x) {
  if (x < 0) putchar('-'), x = -x;
  if (x < 10)
    putchar(x + '0');
  else
    wt(x / 10), putchar(x % 10 + '0');
}
template <class T>
inline void rd(T& x) {
  bool f = 0;
  char ch;
  for (ch = getchar(); ch <= 32; ch = getchar())
    ;
  if (ch == '-') f = 1, ch = getchar();
  for (x = 0; ch > 32; ch = getchar()) x = (x << 3) + (x << 1) + ch - '0';
  if (f) x = -x;
}
const long long N = 45000005;
int tt;
int u, v, w, n, m;
int main() {
  vector<int> a;
  rd(n);
  for (register int i = 1; i <= n; ++i) rd(tt), a.push_back(tt);
  wt(*max_element(a.begin(), a.end()) ^ a.back());
  return 0;
}
