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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: D = None
        self.s: C = None
        self.q: C = None
        self.txt = txt

k = A("k")
j = B("j")
n = C("n")
f = D("f")
i = E("i")
b = E("b")
g = B("g")
m = C("m")
d = C("d")
h = A("h")

k.w = n
k.o = n
k.v = b
j.w = g
n.s = f
n.q = j
f.s = i
i.z = f
i.t = f
i.s = d
i.q = n
b.z = f
b.t = f
b.s = d
b.q = d
g.w = j
m.s = f
m.q = g
d.s = f
d.q = g
h.w = m
h.o = d
h.v = i
assert i.q.s.s.s.q.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: C = None
        self.v: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: D = None
        self.s: C = None
        self.q: C = None
        self.txt = txt

k = A("k")
j = B("j")
n = C("n")
f = D("f")
i = E("i")
b = E("b")
g = B("g")
m = C("m")
d = C("d")
h = A("h")

k.w = n
k.o = n
k.v = b
j.w = g
n.s = f
n.q = j
f.s = i
i.z = f
i.t = f
i.s = d
i.q = n
b.z = f
b.t = f
b.s = d
b.q = d
g.w = j
m.s = f
m.q = g
d.s = f
d.q = g
h.w = m
h.o = d
h.v = i
assert i.q.s.s.s.q.w.txt == "j"