#include <iostream>
#include <algorithm>
using namespace std;
const int N = 1010;
int n;
int a[N];
int main()
{
cin >> n;
for (int i = 0; i < n; i ++ ) cin >> a[i];
int res = 0;
for (int i = 1; i < n; i ++ )
if (abs(a[i] - a[i - 1]) > res)
res = abs(a[i] - a[i - 1]); //遍历求相邻两数之差的最大绝对值
cout << res << endl;
return 0;
}