program ololо;
var
a:array[1..100] of real;
n,i,j:integer;
c,d,y:real;
begin
writeln('Введите количество элементо массива: ');
readln (n);
write('Введите элементы массива: ');
for i:=1 to n do
readln(a[i]);
write('Введите границы интервала R,P: ');
readln(c,d);
for i:=1 to n do
for j:=1 to n do
begin
if i<>j then
if (a[j]>=c) and (a[j]<=d) and (a[i]=a[j]) then begin y:=a[j]; writeln(y); end;
end;
writeln;
readln;
end.