The optimal pebbling number of square of paths and cycles