A person is able to act both selfishly and altruistically and the way in which he/she will eventually act depends on the environment.
Человек способен действовать и эгоистично, и альтруистично, а то, как он в итоге поступит, зависит от среды.