#include #include #include using namespace std; int main(){ int n; cin>> n; vector x(n), y(n); for(int i=0; i> x[i]>> y[i]; } int ans = y[0]-x[0]; bool flag = true; for(int i=1; i0){ cout<< ans<< endl; }else{ cout<< "-1"<< endl; } return 0; }