Ecclesiastes 3:16-22

16 Moreover I saw under the sun, in the place of justice, that wickedness was there; and in the place of righteousness, that wickedness was there.
17 I said in my heart, "God will judge the righteous and the wicked; for there is a time there for every purpose and for every work."
18 I said in my heart, "As for the sons of men, God tests them, so that they may see that they themselves are like animals.
19 For that which happens to the sons of men happens to animals. Even one thing happens to them. As the one dies, so the other dies. Yes, they have all one breath; and man has no advantage over the animals: for all is vanity.
20 All go to one place. All are from the dust, and all turn to dust again.
21 Who knows the spirit of man, whether it goes upward, and the spirit of the animal, whether it goes downward to the eretz?"
22 Therefore I saw that there is nothing better, than that a man should rejoice in his works; for that is his portion: for who can bring him to see what will be after him?