## 3 Materials and Methods
### Synthesis of MWCNTs  
In our research, two types of iron-encapsulated MWCNTs (Fe@MWCNTs), namely commercial Nanocyl NC7000(tm) (Sambreville, Belgium) and synthesized in-house, were used. In-house Fe@MWCNTs were synthesized during 24 h via a catalytic chemical vapor deposition (c-CVD) protocol using the argon atmosphere (760 \({}^{\circ}\)C, argon 99.99% at the flow rate = 1.8 L/min, injection rate of the feedstock = 2.8 mL/h) as the growth environment, and a saturated solution of ferrocene in toluene as the feedstock. A toluene ferrocene solution (5.5 wt.%) dosed (2.8 mL/h) with a syringe pump, pre-evaporated in a heater (250 \({}^{\circ}\)C) controlled by an external unit, was injected into a stream of argon (1.8 L/min) as a carrier gas regulated by a mass flow controller. Hydrocarbon by-products were discharged through an oil scrubber. After synthesis, approximately 16 g of MWCNTs were obtained. To improve their REE affinity, capacity to adsorb REE ions, and further compatibility with polymer matrices--a few modifications were explored. Namely, at first, the oxidation of the carbon nanotube (CNT) surface was carried out to obtain CNT-OH or CNT-COOH, which were further functionalized with IIPs. The characteristic parameters of CNTs used in this study are given in Table 3. MWCNTs were oxidized using a mixture of concentrated sulfuric (VI) acid (95%) and concentrated nitric (V) acid (65%) during reflux. A total of 39 mL of concentrated sulfuric acid (95%) and 13 mL of concentrated nitric acid (65%) were added to 2 g of MWCNTs, which was then heated under reflux to boiling, maintained for 15 min, and then cooled down for 15 min. The prepared solution was poured into 500 mL of deionized water, and the obtained product was filtered under reduced pressure through a G4 sintered funnel and washed with 2.5 L of distilled water to obtain pH 7. The oxidized MWCNTs were dried in an oven to constant weight at 85 \({}^{\circ}\)C for 24 h, obtaining approximately 1.2 g of product.  
Figure 9: Scheme of the multi-stage reaction for obtaining the REEIIP through copolymerization of a complex between the REE(III), 5,7-dichloroquinoline-8-ol, and 4-VP and styrene-DVB as the monomer and crosslinker, respectively.  
MWCNTs were further modified in the reaction with 5,7-dichloro-8-quinolinol and appropriate REE nitrate in DMSO under reflux. A total of 50 mL of DMSO was added to 0.53 g of MWCNTs, and stirred on a magnetic stirrer (500 rpm) for 1 h. Then, 5,7-dichloro-8-quinolinol (0.645 g) and praseodymium nitrate (0.356 g) or neodymium nitrate (0.454 g) or gadolinium nitrate (0.430 g) were added and stirred at room temperature for 12 h. Then, styrene (2.3 mL) and divinylbenzene (2.9 mL) were added and stirred under nitrogen for 15 min. After that, azobisisobutyronitrile (0.110 g) was added and stirred for another 10 min at room temperature.  
The mixture was heated at 60 \({}^{\circ}\)C for 24 h, then cooled to room temperature and filtered under reduced pressure. The modified MWCNTs were washed with DMSO (approximately 150 mL). Finally, the product was treated by 50 mL of 6 M hydrochloric acid solution for 12 h to remove the REE ions. The mixture was stirred in a magnetic stirrer (600 rpm) for 12 h. After this time, the final product in the form of CNTs modified with IIPs was filtered under reduced pressure and washed with deionized water until pH 7 and then dried at 50 \({}^{\circ}\)C to a constant weight.