program info;
type vector=array[0..9] of integer;
var x,y:vector; a,b,n,m,i,j:integer; k:byte;
begin
write('a='); readln(a);
write('b='); readln(b);
n:=0; m:=0;
while a<>0 do begin
n:=n+1;
x[n]:=a mod 10;
a:=a div 10;
end;
while b<>0 do begin
m:=m+1;
y[m]:=b mod 10;
b:=b div 10;
end;
k:=0;
for i:=1 to n do begin
for j:=1 to m do
if x[i]=y[j] then k:=1;
end;
if k=1 then write('Da')
else write('Nu');
readln;
end.
Daca ai ceva intrebari poti sa ma intrebi.