Program asd;
var f,g:text;
t,fs,gs:string;
i,k,n:integer;
IsFilesEqual:boolean;
begin
IsFilesEqual:=true;
assign(f,'fi1.txt');
assign(g,'fi2.txt');
reset(f);
reset(g);
n:=0;
while not eof(f) do
begin
if not IsFilesEqual then
break;
readln(f,fs);
readln(g,gs);
if fs<>gs then
begin
IsFilesEqual:=false;
inc(n);
if length(fs) t:=fs
else
t:=gs;
for i:=1 to length(t) do
if fs[i]<>gs[i] then
begin
k:=i;
break;
end;
end;
end;
close(f);
close(g);
if IsFilesEqual then writeln('Совпадают.')
else
writeln('Строка = ',n,' Позиция = ',k);
readln;
end.