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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: A = None
        self.o: A = None
        self.w: D = None
        self.q: E = None
        self.txt = txt

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

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

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

b = A("b")
l = B("l")
n = C("n")
m = D("m")
j = E("j")
i = C("i")
c = E("c")
h = E("h")
e = B("e")

b.o = h
b.z = n
b.v = n
l.y = i
l.p = b
l.o = b
l.w = m
l.q = j
n.z = b
n.o = i
n.y = i
m.w = j
j.x = e
i.z = b
i.o = n
i.y = n
c.x = e
h.x = l
e.y = i
e.p = b
e.o = b
e.w = m
e.q = c
assert e.q.x.y.z.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.z: C = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: A = None
        self.o: A = None
        self.w: D = None
        self.q: E = None
        self.txt = txt

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

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

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

b = A("b")
l = B("l")
n = C("n")
m = D("m")
j = E("j")
i = C("i")
c = E("c")
h = E("h")
e = B("e")

b.o = h
b.z = n
b.v = n
l.y = i
l.p = b
l.o = b
l.w = m
l.q = j
n.z = b
n.o = i
n.y = i
m.w = j
j.x = e
i.z = b
i.o = n
i.y = n
c.x = e
h.x = l
e.y = i
e.p = b
e.o = b
e.w = m
e.q = c
assert e.q.x.y.z.txt == "b"