#include <iostream>
using namespace std;
int n;
int main(){
cin >> n;
int cnt,res = -2e9;
for(int i = 0;i < n;i++){
int x;
cin >> x;
if(i) res = max(res,abs(cnt - x));
cnt = x;
}
cout << res << endl;
return 0;
}