It took about three weeks for Alton Phonepraseuth and his classmates at West Valley City’s Granger High School, Ivan Padilla and Bailey Beacham, to write their rap about the Boston Massacre — and another week to memorize it.

Annsheri Reay, a student at Monticello High School south of Moab, picked Abigail Adams’ name, because it was first on a list of prominent figures of the Revolutionary War, and she wrote a rap in about an hour.

And Kiysa Gorley, a student at Delta High School in the center of Utah, accompanied herself on ukulele for a minor-key folk song about a brutal winter at Valley Forge, because “I sing better when I sing about sad things.”

Those students, and those from a dozen other Utah high schools statewide, applied their musical talents — and their knowledge of America’s founding — from the stage of Salt Lake City’s Eccles Theater on Friday. From that stage, they drew cheers from 2,000 students in the audience and the appreciation of the touring cast of “Hamilton.”

The occasion was the Hamilton Education Project, also known as EduHam, which the touring Broadway production tries to put on wherever it lands during the school year.

Students competed at their respective schools for the chance to perform on the Eccles stage for the EduHam program. The students were tasked with doing what Lin-Manuel Miranda did as he developed the Tony-winning hip-hop history lesson: study original founding documents and create an original work — song, rap, poem, essay or spoken-word piece — inspired by a figure or an event in American history.

(Rick Egan | The Salt Lake Tribune) Granger High School students Alton Phonepraseuth, Bailey Beacham and Ivan Padilla, Ivan Padilla, perform during a competition in April for EduHam, an education program that accompanies the Salt Lake City run of "Hamilton."

Phonepraseuth said he did the bulk of the writing on his Granger High team’s Boston Massacre spoken-word work, in which each of the three took on the character of someone involved in the event. Phonepraseuth gave voice to Crispus Attucks, the black man who was killed in the British soldiers’ attack; Padilla portrayed silversmith Paul Revere, whose etching of the incident became the illustration for rabble-rousing pamphlets; and Beacham gave voice to John Adams, one of the many politicians moved to action after the massacre.

The hardest part, Phonepraseuth said, was “to find a beat or rhythm that doesn’t sound like anything from ‘Hamilton.’” The effort paid off: After the Granger trio’s performance, actor Kyle Scatliffe, who plays Thomas Jefferson and the Marquis de Lafayette in the touring show was imitating their beat appreciatively.

“Y’all gonna take some of our jobs someday,” Scatliffe remarked during his stint as morning emcee.

Gorley, who plays guitar, took a month to learn the ukulele for her Valley Forge song. As for the lyrics, “I just looked up a ton of facts and just read a lot about it,” she said.

Reay said she picked Abigail Adams, who advised her husband, John Adams, through letters during the Continental Congress, because she “noticed she was very feminist, very pro-woman and way ahead of her time.”

She started putting Abigail’s words into a poem, “but as I started saying it,” the poem became a rap: “We are working with you trying to build a nation / but the men will need the women to form a strong enough foundation.”

(Trent Nelson | The Salt Lake Tribune) Annsheri Reay of Monticello High School performs Friday, May 4, in the Hamilton Education Project, or EduHam, at the Eccles Theater in Salt Lake City.

That was one of many rhymes that drew cheers from the students in the audience. Another came from Misty Villagran, Brittney Herrera and Kiersten Whatcott from Cyprus High School, who sang about the Boston Tea Party: “Don’t cry over spilt tea / seventeen seventy-three / they ate their crumpets dry, polluting the sea / it was the Boston Tea Party.”

Another trio that wowed the audience was from the Utah International Charter School. Ramla Osman and ZamZam Ahmed translated some of their performance in their native Somali, while classmate Klo Plah Hset delivered some lines in Karen, a language from his home country, Myanmar.

Ahmed’s reaction to performing on the “Hamilton” stage echoed many of the students: “It felt amazing all those people were listening to us and watching us,” she said.

After the students performed, members of the “Hamilton” cast — some of whom were watching from the back of the house — sat onstage for a Q&A session.

(Trent Nelson | The Salt Lake Tribune) Members of the touring cast of "Hamilton" answer questions from students in the Hamilton Education Project, or EduHam, at the Eccles Theater in Salt Lake City on Friday May 4, 2018.

The actors talked about researching their roles and reading different takes on history. Marcus Choi, for example, said he’s reading a biography of George Washington, the character he plays. Jon Patrick Walker, who plays King George III, recommended Howard Zinn’s “A People’s History of the United States.”

Mostly, the actors gave students the advice they would have given their teen selves.

“I know it’s cliché, but it gets so much better,” said Ta’rea Campbell, who plays Angelica Schuyler in the show.

And Scatliffe offered this wisdom: “You are the only version of yourself that exists, and that is what makes you special.”

The students were also treated to an afternoon matinee of “Hamilton,” and their responses had a rock-concert intensity. They cheered at every major character’s entrance, hooted during the Cabinet-meeting rap battles and went deadly silent during the second act’s saddest moments.

By intermission, Reay, who rapped about Abigail Adams, said she was speechless.

“This took my breath away,” Reay said. “I’ve been on the edge of my seat the whole time.

The performance for students kicked off the final weekend of the production in Salt Lake City, with Friday night’s show, two on Saturday, and a final matinee on Sunday.

A spokesman for Broadway at the Eccles said that, by the end of the 3½-week run, about 78,000 people will have seen “Hamilton.” All 32 performances, including Friday’s matinee for the students, sold out.