Legendary Entertainment has acquired the feature film rights to Simon Rich’s short story “Any Person, Living or Dead,” with Kumail Nanjiani attached to star.

Rich will adapt the script with Jonathan Krisel set to direct.

The story was recently published by Little, Brown and Company in Rich’s collection of short stories titled “Hits and Misses,” and follows a brilliant reclusive scientist who, using his homemade time machine, gathers a roundtable of the greatest minds in history (Shakespeare, George Washington, Aristotle, etc.) to solve all of humanity’s problems. Unfortunately, his plan fails to take into account language barriers, ancient racism and the tendency of medieval men to commit murder. Instead of learning from these Great Men of History, our hero has no choice but to hunt them down and blast them to the past before they can ruin our future.

Nanjiani will next be seen in Sony’s “Men in Black: International, which opens June 14, followed by Fox’s “Stuber,” which also opens this summer. On the TV side, he will star in one of the episodes for CBS’s reboot of “The Twilight Zone” and is also returning to reprise his role in his HBO series “Silicon Valley.” Nanjiani recently wrapped as exec producer on Paramount’s “Lovebirds,” which he will star in alongside Issa Rae, directed by Michael Showalter. He is represented by UTA, Mosaic, and Schreck Rose Dapello Adams Berlin & Dunham.

Rich most recently wrote Sony’s upcoming Untitled Pickle Comedy starring Seth Rogen and produced by Point Grey Pictures. He was previously a writer on “SNL” for which he received multiple Emmy nominations. He is repped by UTA, Levine Greenberg Literary Agency and Eastman & Eastman.

Krisel is a writer, director and executive producer for “Baskets,” which has been renewed for a fourth season, and previously wrote, directed and executive produced “Portlandia,” for which he received multiple Emmy nominations. He is represented by UTA, Mosaic and Morris Yorn Barnes Levine Krintzman Rubenstein Kohner & Gellman.