rearrange directory structrue in Min Cut & Max Flow