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

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

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

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

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

k = A("k")
i = B("i")
g = C("g")
a = D("a")
h = E("h")
f = B("f")
c = C("c")
d = D("d")

k.t = f
k.q = d
k.o = a
i.s = a
i.w = d
g.s = h
g.u = h
a.q = h
a.z = h
a.y = g
a.w = f
a.r = d
h.v = k
f.s = a
f.w = a
c.s = h
c.u = h
d.q = h
d.z = h
d.y = c
d.w = i
d.r = a
assert c.u.v.t.w.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: D = None
        self.o: D = None
        self.txt = txt

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

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

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

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

k = A("k")
i = B("i")
g = C("g")
a = D("a")
h = E("h")
f = B("f")
c = C("c")
d = D("d")

k.t = f
k.q = d
k.o = a
i.s = a
i.w = d
g.s = h
g.u = h
a.q = h
a.z = h
a.y = g
a.w = f
a.r = d
h.v = k
f.s = a
f.w = a
c.s = h
c.u = h
d.q = h
d.z = h
d.y = c
d.w = i
d.r = a
assert c.u.v.t.w.txt == "a"