Extracting GHZ states from linear cluster states