use std::rc::Rc;
use std::cell::RefCell;

fn main() {
    let a = Rc::new(RefCell::new(String::from("Taro")));
    println!("{}", a.borrow());
    
    *(a.borrow_mut()) = String::from("Hanako");
    println!("{}", a.borrow());
    
    let b = Rc::clone(&a);
    *(b.borrow_mut()) = String::from("Jiro");
    println!("{}", a.borrow());
    
    let c = a.borrow_mut();
    let d = a.borrow_mut();
}