On the roof of a once-grand apartment block overlooking Cairo's Tahrir Square, Shukri Mahmud's father built a humble shack, the din, congestion and worst of the notorious pollution in Africa's biggest metropolis eight floors below.
Mahmud's family and their neighbours are among tens, if not hundreds, of thousands in the burgeoning city that officials say holds at least 18 million people for whom finding affordable housing is a nightmare.
They form what best-selling author Alaa el-Aswany called Cairo's "terrace society," not a world of fashionable sidewalk cafes but a parallel world of rooftop dwellings.
In his 2002 novel "The Yacoubian Building", Aswany evokes the "voices, cries, laughter and coughing, doors shutting and opening, and the aroma of hot water, tea, coffee, charcoal and the muasal of shishas (sweetly flavoured tobacco of hubbly bubblies)."
Such is the world of the terrace society where the Mahmuds live, reached first by an antiquated wood-panelled elevator that opens on to a dark passageway that leads in turn to a maze of rusty iron staircases open to the sky above.
In some cases, as in The Yacoubian Building, poor migrants from the countryside took over small storerooms allocated to each apartment in a building, which were abandoned as better-off residents began moving out to the suburbs.
But Mahmud's father had been a bawab (doorkeeper) in their building and was given a plot on the roof where he could build.
"I was born here; I grew up here; I got married here," said Mahmud, 55, sitting in the living room, its green walls decorated with photographs of Koranic verses and the Muslim holy city of Mecca.
With a hint of nostalgia, he remembers generations of residents who once lived in the posh apartments below.
In those days, it was not just Egyptians, but also Greeks and Britons, especially during the days when Egypt was effectively a British protectorate.
Over the years, Mahmud has managed to accumulate some "modern conveniences."
"Each month I pay rent, electricity, water and telephone bills," he said.
This vertical growth has mushroomed in recent decades as the capital's population swelled and the state was unable to offer low-cost housing, says Roman Stadnicki, an analyst with Cairo-based CEDEJ, a French research institute.
"Unplanned constructions have become an urban norm in Egypt. Sixty-five percent of urbanised space in Cairo is unplanned," he said.
On the one hand, sprawling districts that are almost entirely unplanned and illegal have sprung up on the ground, while many people find shelter on rooftops, he said.
No takers for desert townships
One gets a feel of what it's like in the Mahmud's cramped kitchen, where wife Sayyida is busy preparing lunch for their two teenagers.
Signup to our newsletter and follow us on Facebook and Twitter!
She joined her husband here when they married 30 years ago, and the couple can't imagine living anywhere else.
"Here, we all know each other; we understand each other. I don't think I could get used to new neighbours in an unfamiliar district," Mahmud said.
Years ago, in an effort to relieve the congestion, and make housing affordable, the government created townships in the middle of the desert outside Cairo.
But Mahmud says he couldn't afford to move 30 kilometres (19 miles) away from where he works. The daily commute to work in central Cairo would cost him a quarter of his wages.
The townships have failed to attract buyers, and Stadnickiy says they are "unanimously considered to be a failure".
There is also a paradox linked to the population explosion -- as many as 30-40 percent of housing units in Cairo and the townships lie vacant.
Either property owners have bought properties to speculate, while others are simply hesitant to let them out because of the difficulty of evicting unsavoury tenants and of raising rents.
'Where do we go?'
A few metres from Mahmud's apartment, hidden behind several satellite dishes and the winch-housings of old elevators, live Gamal Hashem and his brother.
The two, now in their sixties, moved here as teenagers, after their father, who was also a bawab in the building, was given his plot on the terrace.
"I am the one who built all this," said Gamal, pointing to the house, its plywood walls painted in white.
The house has a balcony, a spartan kitchen and a small living room with a television and a computer.
The wooden ceiling has rotted from years of humidity, and steady rain drops on this winter's day left puddles on the floor.
In another room, their important papers, books and clothes are piled on a bed, wrapped in waxed cloth.
Gamal used to run a small hotel, but says he got kicked out several years ago, a victim of "corruption" under the regime of former president Hosni Mubarak. The two of them are now unemployed and struggle to find odd jobs to keep them afloat.
But despite their hardships, the two brothers can't imagine staying anywhere else.
"Each time a new flat owner arrives, he wants us to leave, but where do we go," asked Gamal, who pays his rent regularly.
"The people I have met here and our relationships are more valuable than all the money in the world."