#!/bin/sh
#
# solves the general case of the 8 queens problem;
# invoke as queens -n, where n is a digit > 3
#
# self-extracting with granularity 77
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 3.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
#\
exec avram --par "$0"  "$@"
sSr{EIoAJGhuMstt{p^bsfW?kxhoooZIj_ggitNn_Ilxw{WVvJE_NW{Xpenxtrth{xgp_drzpkhgIzl
K<ciz{wr{wsGI{djdpoxF[cwmF[cvRsHs[kFxJ^Dhv]ZExjtdSlKuxajnoZnzHtjElVr[]Agm?Uzmze
{MwgoIqgIr_oNvYdHCo`a>\l[@MXdcyAvvyHnwxQwRiNLyfN`mt>yUHZfZT=jn[gfjokIG[GgFncGf`
nf=]WVH=]=lVczJ=ZodkpkzKkkh?GMV^wGF\>B?OfB>`\][=cvKnSHgvkOKFnzpINaHxqL=?Jnlaoav
HAxkuYVPKQJeQsQIusnrfKEhFEPF\n_CtJ[dzyEqngqGJgS[HlqqkyXnENXsQ\OPA=j<=KOPqQDjaO^
hKoW{mXsQQqVQYDCIOO{QPi=[kwKOLpwxlnYIXAmSYZoQq{yUPHXCI<dOqQVdLd[fAxIgGgOKuOHh[Z
jmoSAq[OhIQQSYSSo\\kQIVo>MZf[iPTXj>KKo<^m{qnxSUcfC`nOmK{YkQSzyq`qJGQFhnuzI=KAPn
VEJkHh?QQcSNHVgSMQyuHPQKOQWqRwCqXQQXfdnXphQ=@AtkzvbXoKHnkQGOIFtoXEXBgpIHQYI[q[P
QzSPrQuS_Yq=OHqQPlUz<dSsCHfmJnkTpngNe`wG\XyKy__IwAFqQSl{xYQZ@BXZILYc\dDsQ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