using System;
public class Program
{
public static int CheckValue(int[] H)
int Ch = H[1] - H[0];
for(int i=0;i<H.Length-1;i++)
if(H[i+1]-H[i]!=Ch)
return (-1);
return (Ch);
}
public static void main(string[] args)
int[] H = { 1, 3, 9, 15, 17, 23, 25, 29, 33, 35 };
int Ch =H[1] - H[0];
if (CheckValue(H) != Ch)
Console.Write(-1);
else
Console.Write(Ch);