<?php
$text = "А Б В Г Д Е Ё Ж З И К Л М Н О П Р С Т У Ф Х Ц Ч Ш Щ";
$n = 53;
$field = [];
/*
print_r($text);
*/
for ($i=0; $i<count($text); $i++) { $y*=14;
$y+=15;
//echo "$y ";
$field[$y][round($i*2)] = $text[$i]; }
for ($i=0; $i<count($field); $i++) {
for ($j=0; $j<count($field[0]); $j++) { echo $field[$i][$j];
echo " ";
}
echo "\n";
}
PD9waHAKJHRleHQgPSAi0JAg0JEg0JIg0JMg0JQg0JUg0IEg0JYg0Jcg0Jgg0Jog0Jsg0Jwg0J0g0J4g0J8g0KAg0KEg0KIg0KMg0KQg0KUg0KYg0Kcg0Kgg0KkiOwokdGV4dCA9IGV4cGxvZGUoIiAiLCAkdGV4dCk7CiRuID0gNTM7CiRmaWVsZCA9IFtdOwokZmllbGQgPSBhcnJheV9maWxsKDAsIDM1LCBhcnJheV9maWxsKDAsICRuLCAnICcpKTsKCi8qCgpwcmludF9yKCR0ZXh0KTsKKi8KZm9yICgkaT0wOyAkaTxjb3VudCgkdGV4dCk7ICRpKyspIHsKCSR5ID0gc2luKCRpKnBpKCkvMTApOwoJJHkqPTE0OwoJJHkrPTE1OwoJJHk9cm91bmQoJHkpOwoJLy9lY2hvICIkeSAiOwoJJGZpZWxkWyR5XVtyb3VuZCgkaSoyKV0gPSAkdGV4dFskaV07Cn0KCmZvciAoJGk9MDsgJGk8Y291bnQoJGZpZWxkKTsgJGkrKykgewoJCglmb3IgKCRqPTA7ICRqPGNvdW50KCRmaWVsZFswXSk7ICRqKyspIHsKCQllY2hvICRmaWVsZFskaV1bJGpdOwoJCWVjaG8gIiAiOwoJfQoJZWNobyAiXG4iOwp9