type
person=record
fam:string;
imya:string;
day:integer;
end;
var
a:array[1..50] of person;
i,n,z:integer;
begin
write('n=');readln(n);
for i:=1 to n do
write('fam-');readln(a[i].fam);
write('imya-');readln(a[i].imya);
write('day-');readln(a[i].day);
write('z-');readln(z);
if a[i].day=z then writeln (a[i].fam, ' ',a[i].imya);
readln;
end.
type
person=record
fam:string;
imya:string;
day:integer;
end;
var
a:array[1..50] of person;
i,n,z:integer;
begin
write('n=');readln(n);
for i:=1 to n do
begin
write('fam-');readln(a[i].fam);
write('imya-');readln(a[i].imya);
write('day-');readln(a[i].day);
end;
write('z-');readln(z);
for i:=1 to n do
if a[i].day=z then writeln (a[i].fam, ' ',a[i].imya);
readln;
end.