#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
const int N = 1010;
int n;
int a[N];
int ans = 0;
int main()
{
cin>>n;
for(int i = 0; i<n; i++) cin>>a[i];
for(int i = 1; i<n; i++)
ans = max(ans,abs(a[i]-a[i-1]));
cout<<ans;
return 0;
}