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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: C = None
        self.s: D = None
        self.r: B = None
        self.txt = txt

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

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

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

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

l.y = j
l.z = j
l.w = e
g.o = l
g.z = k
g.s = e
g.r = j
i.p = g
i.w = j
i.u = c
i.z = k
e.v = l
e.p = m
e.w = m
e.x = c
h.v = g
c.y = g
c.z = j
c.w = e
n.v = g
k.p = j
k.w = j
k.u = l
k.z = i
j.o = c
j.z = i
j.s = e
j.r = g
m.v = j
assert m.v.z.w.s.w.v.s.v.z.s.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: B = None
        self.w: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: C = None
        self.s: D = None
        self.r: B = None
        self.txt = txt

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

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

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

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

l.y = j
l.z = j
l.w = e
g.o = l
g.z = k
g.s = e
g.r = j
i.p = g
i.w = j
i.u = c
i.z = k
e.v = l
e.p = m
e.w = m
e.x = c
h.v = g
c.y = g
c.z = j
c.w = e
n.v = g
k.p = j
k.w = j
k.u = l
k.z = i
j.o = c
j.z = i
j.s = e
j.r = g
m.v = j
assert m.v.z.w.s.w.v.s.v.z.s.txt == "e"