class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: D = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: D = None
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: H = None
        self.p: D = None
        self.t: H = None
        self.q: B = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: B = None
        self.t: H = None
        self.o: B = None
        self.x: I = None
        self.v: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: D = None
        self.r: E = None
        self.s: A = None
        self.x: C = None
        self.y: H = None
        self.u: B = None
        self.z: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: D = None
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: H = None
        self.p: D = None
        self.t: H = None
        self.q: B = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: B = None
        self.t: H = None
        self.o: B = None
        self.x: I = None
        self.v: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: D = None
        self.r: E = None
        self.s: A = None
        self.x: C = None
        self.y: H = None
        self.u: B = None
        self.z: G = None
        self.txt = txt

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

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