#include<iostream>
#include<algorithm>
using namespace std;
int main(){
int n;
cin>>n;
int a[1001];
cin>>a[1];
int sum = 0;
for(int i=2;i<=n;i++){
cin>>a[i];
sum = max(abs(a[i]-a[i-1]),sum);
}
cout<<sum<<endl;
return 0;
}