<?php

// your code goes here

foreach($arr as $subarr){
	$currentIndex = key($arr);
	$newSubarr = array_push(array_reverse($subarr),$currentIndex);
	
}