class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: A = None
        self.q: B = None
        self.u: A = None
        self.txt = txt

i = A("i")
b = B("b")
n = C("n")
m = D("m")
e = C("e")
c = B("c")

i.t = e
i.p = m
b.o = i
b.v = e
n.w = b
m.o = n
m.t = i
m.u = i
m.q = b
e.w = c
c.o = i
c.v = n
assert c.v.w.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: A = None
        self.q: B = None
        self.u: A = None
        self.txt = txt

i = A("i")
b = B("b")
n = C("n")
m = D("m")
e = C("e")
c = B("c")

i.t = e
i.p = m
b.o = i
b.v = e
n.w = b
m.o = n
m.t = i
m.u = i
m.q = b
e.w = c
c.o = i
c.v = n
assert c.v.w.v.txt == "e"