It's in the Old Testament, the third and fourth chapters of 1 Esdras, a book held as part of the deuterocanon in the Eastern Orthodox Church (and also Oriental Orthodoxy), and as apocryphal by Protestants and Roman Catholics.
It's a lengthy passage, so I won't quote it in full (but it can be read here, it's chapters 3 and 4), but the gist of it: the king asks his three bodyguards to each write a sentence, and whoever's is the wisest sentence will be greatly rewarded.
The one who says wine is strongest is our cynic, the one who says the king is strongest is our rationalist, the one who says truth is strongest is our believer.3:10 The first wrote, “Wine is the strongest.†11 The second wrote, “The king is strongest.†12 The third wrote, “Women are strongest: but above all things Truth beareth away the victory.â€
Again, I'm not saying that this was Tarkovsky's inspiration for the Writer/Scientist/Stalker character set, I've just found this a fascinating subject ever since I realized how often this intellectual structure appears in various forms.
