Keilim18: 6
מִטָּה שֶׁהָיְתָה טְמֵאָה מִדְרָס, נִשְׁבְּרָה אֲרוּכָה וְתִקְּנָהּ — טְמֵאָה מִדְרָס. נִשְׁבְּרָה שְׁנִיָּה וְתִקְּנָה — טְהוֹרָה מִן הַמִּדְרָס, אֲבָל טְמֵאָה מַגַּע מִדְרָס. לֹא הִסְפִּיק לְתַקֵּן אֶת הָרִאשׁוֹנָה עַד שֶׁנִּשְׁבְּרָה שְׁנִיָּה — טְהוֹרָה.
[Regarding] a bed that was tamei midras, [if one] long board broke and [the owner] repaired it, it is [still] tamei midras. [If] the second [long board then] broke and he repaired it, [the bed] is tahor from midras [tumah], but it is tamei [due to] contact with a midras [hazav]. If he did not manage to repair the first [board] before the second [board] broke, [the bed is] tahor.