class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.u: G = None
        self.r: E = None
        self.t: D = None
        self.s: F = None
        self.v: H = None
        self.p: I = None
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: B = None
        self.z: I = None
        self.r: H = None
        self.s: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: I = None
        self.t: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: H = None
        self.o: F = None
        self.w: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: I = None
        self.z: B = None
        self.s: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: D = None
        self.u: F = None
        self.x: C = None
        self.t: F = None
        self.v: E = None
        self.w: C = None
        self.o: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.u: G = None
        self.r: E = None
        self.t: D = None
        self.s: F = None
        self.v: H = None
        self.p: I = None
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: B = None
        self.z: I = None
        self.r: H = None
        self.s: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: I = None
        self.t: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: H = None
        self.o: F = None
        self.w: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: I = None
        self.z: B = None
        self.s: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: D = None
        self.u: F = None
        self.x: C = None
        self.t: F = None
        self.v: E = None
        self.w: C = None
        self.o: H = None
        self.txt = txt

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

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