They were sitting on benches alongside the then 15-year-old education campaigner in a converted Toyota truck, clasping their books, as they travelled home after a chemistry exam in Mingora, north-west Pakistan.
Kainat remembers excitedly discussing the answers, while Shazia was staring out of the window, daydreaming, when the lives of the three girls changed for ever.
"The Taliban stopped us, two boys - or men," says Shazia. "One was in the front and the other one came to the back. He said: 'Who is Malala?' We had our faces covered [with niqabs], but Malala didn't.
"We were looking at him and then he shot Malala in the forehead. He shot me on my hand and shoulder, and Kainat's shoulder as well. Then he started shooting randomly."
Kainat recalls seeing Malala fall to the floor and hearing her classmates' screams, before she fainted. Shazia says she was one of those screaming.
Eventually the bus, winding through heavy traffic, arrived at the local hospital. Malala and Shazia were rushed inside, but Kainat was terrified so she ran home, gripping her arm all the way. When she reached her father, a headmaster, and mother, a midwife, she uttered just two words: "Malala died."
"I was lost," she says softly. "I could not sleep because whenever I closed my eyes I thought that guy was going to come and shoot me again."
Kainat was taken by her family to the local hospital, while Shazia spent a month in a military hospital in the regional capital, Peshawar.
Malala's injuries were so complex that she was flown to the UK for life-saving treatment at Queen Elizabeth Hospital in Birmingham. She had splinters of skull in her brain, and her heart and kidneys were failing. The Peshawar intensive care unit was so basic that it had only one sink - and that didn't work.
While Malala, within hours of the attack, had been elevated to the status of international heroine, Shazia and Kainat suffered in obscurity. They returned to recuperate at home in Pakistan's Swat Valley, but were treated as pariahs.
Neighbours turned on Kainat's family, telling them to leave because she was seen as a Taliban target; bus and taxi drivers refused to take her to school.
Eight thousand kilometres away, Malala was the focus of increasing global attention, as the world watched her recovery. Tens of thousands of people signed a petition calling for her to be nominated for the Nobel Peace Prize. By July 2013, on her 16th birthday, she was addressing the United Nations.
She was also inundated with offers to continue her education. One of these came from the prestigious international boarding school, UWC Atlantic College, in the Vale of Glamorgan, South Wales. Malala replied that she was settled in Birmingham, enrolled at the private Edgbaston High School for Girls.
But she had not forgotten her two friends and asked if the invitation could be extended to them instead. Shazia and Kainat were given full scholarships (more than half of the students receive a bursary to cover fees that would otherwise reach £58,000 for two years), while Gordon Brown, UN special envoy on global education, helped with visas.
The girls arrived in 2013, leaving their families behind.
Atlantic College, set in a 12th-century castle, could not be further from their modest homes in rural Pakistan. Instead of lush green mountains, the girls are surrounded by sheep farms. Sitting in the cold principal's office today, they describe their initial feelings of disorientation - and freedom.
"Back home, you have to go anywhere with your father, mother or brother, because you are a girl," explains Shazia, daughter of a bakery owner, and one of nine children. The girls relished being able to visit the shops alone and learnt to swim ("we don't have pools for girls in Swat").
British food, however, demanded more adjustment. "Now I can eat pasta and pizza, which I couldn't even look at before," says Kainat.
They order Indian takeaways to create a home away from home. Is British biryani as good? "They try their best," says Shazia diplomatically.
The girls' fellow pupils were unfazed by their arrival. Many did not even know their story for several months, until they gave a speech at a student conference.
"Everyone treats us normally," says Kainat. "They call us Kainat and Shazia, not Malala's friends. We are famous in Pakistan. Here, we are not special."
While Malala was surrounded by family in Birmingham, her two friends had only each other, travelling twice a year to Swat - a place to which Malala has not been able to return due to the threats.
Now, both 19, any homesickness has faded, replaced by soul-searching about how to fit into two radically different worlds.
Says Kainat: "If I'm wearing jeans and my friends [in Pakistan] see pictures online, they say: 'You forgot your culture.'
Her family, however, are adamant they did the right thing. Kainat relays a conversation in which her father told her to ignore others. "Now if people say: 'Don't wear nail polish', I want to know why," she adds, tapping her leopard-print trainers with maroon-painted fingers.
Though Malala was the trailblazer - aged 11, she had written a BBC blog and appeared on Pakistani TV to promote her campaign for girls' education - the three are now united behind the same cause.
Kainat, once shy, is confident about her mission. "Before, my mind was closed," she says. "I thought education just related to my family. But now I think about all girls. I want to stand up for them."
Her outlook is global. Though her parents have never left Pakistan, she shares a dorm with roommates from Brazil, Lebanon and Bermuda. And while Malala has dominated, her friends have travelled to conferences in Paris and Washington - not to mention the Nobel Peace Prize ceremony in Oslo.
To their amazement, Malala mentioned them in her speech when she became the youngest Nobel laureate, aged 17, in 2014. "I am not a lone voice. I am many. I am Malala, but I am also Shazia. I am Kainat," she told a spellbound audience.
"We are really proud," says Shazia, "we follow her and we will follow her in the future."
The three still chat online and met up in Birmingham to celebrate Eid, though they admit these get-togethers are increasingly rare. They have witnessed first-hand their friend's celebrity - Shazia says Malala struggles to go shopping without being mobbed.
Back in Wales, the girls say teachers have dubbed them the "Pakistani twins" because they are inseparable. Both erupt into giggles. They rise at 5.30am to pray before lessons. When not studying, they can be found dancing, kayaking and surfing on the Welsh coast.
The nightmares they still suffered when they arrived are behind them - now the only daily reminders are their scars and the shoulder pains they get in cold weather.
But both are aware of how different life might have been. "Some of my friends are married and have children," explains Kainat.
The girls' sights are set on university. While Malala has received an offer from a top institution - understood to be Oxford - her friends were last month both given offers to study nursing at Edinburgh. Brown, who has become a mentor, is helping to find sources of funding.
They are keen to restart campaigning. And both see their futures in Pakistan.
Kainat says: "I believe I should go back to my country and try to make change there".
Adds Shazia: "However we can help, we will."