Maaser Sheni 3:8-9
Ma’aser Sheini 3:8
If chambers of the Temple courtyard were built on sacred land with entrances on secular land, then the interior of these chambers were secular and the rooves were sanctified. If they were built on secular land with entrances on sacred land, then the interiors were sanctified and the rooves were secular. If they were built on both sacred and secular land with entrances on both sacred and secular land, then the interiors and rooves opposite sacred land were sanctified and those opposite secular land were not.
Ma’aser Sheini 3:9
Let’s say that second tithe produce was brought into Jerusalem and was rendered ritually impure, either by a primary source of impurity (av hatumah) or by a secondary source of impurity (vlad hatumah), either inside or outside the city. In such a case, Beis Shammai say that the produce must be redeemed but it must still be eaten in Jerusalem, though that which was rendered impure by an av hatumah outside the city (the most intense impurity given these parameters) may be removed. Beis Hillel say that it all must be redeemed and may be eaten outside the city, though that which was rendered impure by a vlad hatumah inside the city (the least intense scenario given these parameters) may not be removed.