#include using namespace std; int main(){ int n; cin >> n; int x,y; cin >> x >> y; int check = y - x; for(int i = 0; i < n - 1; i++){ if(check != y - x) check = -1; break; } cout << (check < 0 ? -1 : check) << endl; return 0; }