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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: I = None
        self.x: A = None
        self.p: A = None
        self.v: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: G = None
        self.t: E = None
        self.q: C = None
        self.y: A = None
        self.x: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: B = None
        self.t: E = None
        self.v: G = None
        self.w: E = None
        self.x: H = None
        self.s: E = None
        self.txt = txt

h = A("h")
k = B("k")
b = C("b")
i = D("i")
e = E("e")
c = F("c")
f = G("f")
j = H("j")
m = I("m")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: I = None
        self.x: A = None
        self.p: A = None
        self.v: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: G = None
        self.t: E = None
        self.q: C = None
        self.y: A = None
        self.x: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: B = None
        self.t: E = None
        self.v: G = None
        self.w: E = None
        self.x: H = None
        self.s: E = None
        self.txt = txt

h = A("h")
k = B("k")
b = C("b")
i = D("i")
e = E("e")
c = F("c")
f = G("f")
j = H("j")
m = I("m")

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