Second nearest neighbour Josephson coupling in layered superconducting structures