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

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.v: B = None
        self.w: C = None
        self.x: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: D = None
        self.o: G = None
        self.s: E = None
        self.txt = txt

d = A("d")
m = B("m")
g = C("g")
n = D("n")
j = E("j")
c = F("c")
e = G("e")
k = H("k")

d.p = g
d.w = g
d.z = g
d.v = j
d.u = m
m.r = n
g.o = e
n.w = c
n.z = g
j.s = k
j.v = m
j.w = g
j.x = c
c.z = m
e.t = j
k.t = d
k.p = n
k.o = e
k.s = j
assert e.t.w.o.t.s.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: C = None
        self.z: C = None
        self.v: E = None
        self.u: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.v: B = None
        self.w: C = None
        self.x: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: D = None
        self.o: G = None
        self.s: E = None
        self.txt = txt

d = A("d")
m = B("m")
g = C("g")
n = D("n")
j = E("j")
c = F("c")
e = G("e")
k = H("k")

d.p = g
d.w = g
d.z = g
d.v = j
d.u = m
m.r = n
g.o = e
n.w = c
n.z = g
j.s = k
j.v = m
j.w = g
j.x = c
c.z = m
e.t = j
k.t = d
k.p = n
k.o = e
k.s = j
assert e.t.w.o.t.s.txt == "k"