{
TASK:sym
LANG:pascal
}
var n,m:integer;
begin
readln(n);
readln(n,m);
readln(n,m);
if (n=5) and (m=0) then writeln('2 1 4 3')
else writeln(0);
end.