class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: E = None
        self.w: H = None
        self.u: H = None
        self.z: C = None
        self.q: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: A = None
        self.u: E = None
        self.y: H = None
        self.w: I = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: I = None
        self.y: B = None
        self.x: I = None
        self.q: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: D = None
        self.r: A = None
        self.x: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: A = None
        self.u: E = None
        self.y: H = None
        self.w: I = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: I = None
        self.y: B = None
        self.x: I = None
        self.q: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: D = None
        self.r: A = None
        self.x: E = None
        self.txt = txt

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

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

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