#include using namespace std; using ll=long long; using pll=pair; using tll=tuple; using ld=long double; const ll INF=(1ll<<60); #define rep(i,n) for (ll i=0;i<(ll)(n);i++) #define all(v) v.begin(),v.end() template inline bool chmin(T &a,T b){ if(a>b){ a=b; return true; } return false; } template inline bool chmax(T &a,T b){ if(a> n; vector a(n); rep(i,n) cin >> a[i]; set st; ll b=INF; rep(i,n){ if(i==0) cout << "0\n"; else{ auto x=st.lower_bound(a[i]); auto y=x; y--; ll ans=b; if(x!=st.end()) chmin(ans,abs((*x)-a[i])); if(y!=st.end()) chmin(ans,abs((*y)-a[i])); cout << ans << '\n'; chmin(b,ans); } st.insert(a[i]); } }