read N M
maru_data=$(cat)


c_d=$(echo $maru_data | grep -o -E "\-?[0-9]+ \-?[0-9]+"|tail -n $M)

echo $maru_data | grep -o -E "\-?[0-9]+ \-?[0-9]+"|head -n $N|
    awk ' {print("mae awk sqt {print(abs("$1"-one) + abs("$2"-two))} sqt ato")}' |
    sed "s/sqt/\'/g" | sed 's/one/$1/g' |sed 's/two/$2/g' | sed 's/abs\(([^\)]*)\)/sqrt((\1)^2)/g'|
    sed "s/mae/echo $(echo $c_d) | grep -o -E '\\\-?[0-9]+ \\\-?[0-9]+' |/g" |
    sed 's/ato/| cat -n | sort -n -s -k 2|head -n 1|cut  -f 1/g' | bash | tr -d " "


