Invariants of the Monte Carlo Simulation