$a = [0 => "К", 1 => "О", 2 => "Р"];
$k = 0;
foreach (range(0, count($a)) as $i)
foreach (range(0, count($a)) as $j)
foreach (range(0, count($a)) as $g)
foreach (range(0, count($a)) as $m)
foreach (range(0, count($a)) as $n) {
$k++;
if ($k === 238)
echo $a[$i], $a[$j], $a[$g], $a[$m], $a[$n] . " ";
}
?>
k = 0
for i in range(0, len(a)):
for j in range(0, len(a)):
for g in range(0, len(a)):
for m in range(0, len(a)):
for n in range(0, len(a)):
k += 1
if k == 238:
print(a[i], a[j], a[g], a[m], a[n], end=" ")