class A:
    def __init__(self, txt: str):
        self.t: I = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: C = None
        self.v: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.o: A = None
        self.w: G = None
        self.p: H = None
        self.u: D = None
        self.x: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: I = None
        self.o: G = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: C = None
        self.v: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.o: A = None
        self.w: G = None
        self.p: H = None
        self.u: D = None
        self.x: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: I = None
        self.o: G = None
        self.txt = txt

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

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

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