middlepattern