class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: D = None
        self.y: F = None
        self.z: E = None
        self.r: E = None
        self.t: A = None
        self.v: E = None
        self.u: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: I = None
        self.o: F = None
        self.x: H = None
        self.r: C = None
        self.t: A = None
        self.q: B = None
        self.u: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: D = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.w: H = None
        self.p: I = None
        self.v: B = None
        self.q: A = None
        self.o: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: G = None
        self.u: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: B = None
        self.u: C = None
        self.y: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: D = None
        self.y: F = None
        self.z: E = None
        self.r: E = None
        self.t: A = None
        self.v: E = None
        self.u: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: I = None
        self.o: F = None
        self.x: H = None
        self.r: C = None
        self.t: A = None
        self.q: B = None
        self.u: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: D = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.w: H = None
        self.p: I = None
        self.v: B = None
        self.q: A = None
        self.o: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: G = None
        self.u: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: B = None
        self.u: C = None
        self.y: A = None
        self.txt = txt

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

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