1D pancake code