class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

e = A("e")
c = B("c")
i = B("i")

e.o = i
c.v = i
i.v = c
assert e.o.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

e = A("e")
c = B("c")
i = B("i")

e.o = i
c.v = i
i.v = c
assert e.o.v.v.txt == "i"