class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: H = None
        self.q: F = None
        self.s: G = None
        self.t: C = None
        self.o: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.z: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.w: H = None
        self.x: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

h.v = j
h.y = c
h.q = g
h.s = e
h.t = m
h.o = m
n.t = e
n.u = g
m.z = f
j.t = h
j.p = c
j.x = e
f.x = e
f.z = c
g.o = e
g.w = c
g.x = f
e.x = g
c.s = h
assert g.x.z.s.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: H = None
        self.q: F = None
        self.s: G = None
        self.t: C = None
        self.o: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.z: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.w: H = None
        self.x: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

h.v = j
h.y = c
h.q = g
h.s = e
h.t = m
h.o = m
n.t = e
n.u = g
m.z = f
j.t = h
j.p = c
j.x = e
f.x = e
f.z = c
g.o = e
g.w = c
g.x = f
e.x = g
c.s = h
assert g.x.z.s.txt == "h"