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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: A = None
        self.v: A = None
        self.q: A = None
        self.txt = txt

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

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

j = A("j")
m = B("m")
c = C("c")
i = D("i")
e = E("e")
g = D("g")
b = C("b")

j.w = m
j.z = e
j.o = g
m.z = e
c.x = e
c.p = j
c.v = j
c.q = j
i.q = j
i.p = j
e.o = m
e.t = g
e.r = j
g.q = j
g.p = j
b.x = e
b.p = j
b.v = j
b.q = j
assert i.p.w.z.r.w.z.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: E = None
        self.o: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: A = None
        self.v: A = None
        self.q: A = None
        self.txt = txt

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

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

j = A("j")
m = B("m")
c = C("c")
i = D("i")
e = E("e")
g = D("g")
b = C("b")

j.w = m
j.z = e
j.o = g
m.z = e
c.x = e
c.p = j
c.v = j
c.q = j
i.q = j
i.p = j
e.o = m
e.t = g
e.r = j
g.q = j
g.p = j
b.x = e
b.p = j
b.v = j
b.q = j
assert i.p.w.z.r.w.z.txt == "e"