Manley–Rowe relations for an arbitrary discrete system