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

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

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

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

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

f = A("f")
h = B("h")
c = C("c")
m = D("m")
a = E("a")
i = B("i")
l = C("l")
g = B("g")
e = A("e")

f.q = g
h.y = a
h.o = g
c.s = g
c.z = h
c.w = l
c.v = m
m.p = l
a.u = m
i.y = a
i.o = h
l.s = h
l.z = g
l.w = c
l.v = m
g.y = a
g.o = h
e.q = g
assert h.y.u.p.w.w.v.p.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

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

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

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

f = A("f")
h = B("h")
c = C("c")
m = D("m")
a = E("a")
i = B("i")
l = C("l")
g = B("g")
e = A("e")

f.q = g
h.y = a
h.o = g
c.s = g
c.z = h
c.w = l
c.v = m
m.p = l
a.u = m
i.y = a
i.o = h
l.s = h
l.z = g
l.w = c
l.v = m
g.y = a
g.o = h
e.q = g
assert h.y.u.p.w.w.v.p.s.y.txt == "a"