<?php
$text = "А Б В Г Д Е Ё Ж З И К Л М Н О П Р С Т У Ф Х Ц Ч Ш Щ";
$text = explode(" ", $text);
$n = 53;
$field = [];
$field = array_fill(0, 35, array_fill(0, $n, ' '));

/*

print_r($text);
*/
for ($i=0; $i<count($text); $i++) {
	$y = sin($i*pi()/10);
	$y*=14;
	$y+=15;
	$y=round($y);
	//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";
}