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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: I = None
        self.s: D = None
        self.q: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: I = None
        self.q: D = None
        self.w: C = None
        self.u: B = None
        self.s: F = None
        self.r: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: H = None
        self.o: A = None
        self.z: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: I = None
        self.s: D = None
        self.q: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: I = None
        self.q: D = None
        self.w: C = None
        self.u: B = None
        self.s: F = None
        self.r: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: H = None
        self.o: A = None
        self.z: C = None
        self.txt = txt

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

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