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

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

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: F = None
        self.r: H = None
        self.w: B = None
        self.z: G = None
        self.y: B = None
        self.p: B = None
        self.txt = txt

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

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

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

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

m = A("m")
g = B("g")
c = C("c")
d = D("d")
a = E("a")
e = F("e")
f = G("f")
h = H("h")
i = H("i")
k = B("k")

m.s = h
m.u = f
g.p = a
c.u = a
c.x = g
c.w = e
c.t = e
c.v = h
d.x = m
d.u = e
d.r = i
d.w = k
d.y = k
d.z = f
d.p = g
a.s = g
a.p = m
a.q = k
e.w = g
e.t = g
f.t = g
f.w = c
h.t = f
i.t = f
k.p = a
assert g.p.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.s: H = None
        self.u: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: F = None
        self.r: H = None
        self.w: B = None
        self.z: G = None
        self.y: B = None
        self.p: B = None
        self.txt = txt

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

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

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

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

m = A("m")
g = B("g")
c = C("c")
d = D("d")
a = E("a")
e = F("e")
f = G("f")
h = H("h")
i = H("i")
k = B("k")

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