matching elementary shapes to corresponding holes