Ecclesiastes 8:14

14 There is a vanity which is done upon the earth, that there are righteous men unto whom it happeneth according to the work of the wicked; again, there are wicked men to whom it happeneth according to the work of the righteous: I said that this also is vanity.