#include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
int main()
{
int n;
cin >> n;
int a[n];//存每个数(其实存两个数就行了)
int max = 0;//存最大差
for(int i = 0;i < n;i++)
{
cin >> a[i];
int t;
if(i == 0){
t = 0;
}
else t = abs(a[i] - a[i-1]);
if(t > max)max = t;
}
cout << max << endl;
return 0;
}