program cap_so_cong;
Uses crt;
var A:array[1..1000] of integer;
n,i,t:integer;
begin
clrscr;
write('Nhap so n: '); readln(n);
for i:=1 to n do
begin
write('Nhap so thu ',i,': '); readln(A[i]);
end;
t:=A[2]-A[1];
for i:=2 to n-1 do
if A[i+1]-A[i]<>t then break;
if i=n then write('La cap so cong va so cong la ',t)
else write('Khong phai');
readln;
end.