//有一点疑问:B和C得第二,什么意思?
program simple;
var a,b,c:shortint;
begin
for a:=1 to 3 do
for b:=1 to 3 do
for c:=1 to 3 do
if (a<>b)and(b<>c)and(a<>c)and
(ord(a=1)+ord((b=2)or(c=2))+ord(b<=2)+ord(c=3)+ord(a<>2)+ord(b<>1)=3)
then
begin
writeln('A:No.',a);
writeln('B:No.',b);
writeln('C:No.',c);
end;
readln;
end.
begin
writeln('A第一,B第二,C第三');
end.