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

class B:
    def __init__(self, txt: str):
        self.w: J = None
        self.q: D = None
        self.x: C = None
        self.z: C = None
        self.v: E = None
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: J = None
        self.o: E = None
        self.t: J = None
        self.z: E = None
        self.u: H = None
        self.v: B = None
        self.p: A = None
        self.r: D = None
        self.y: J = 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.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: D = None
        self.y: A = None
        self.v: H = None
        self.p: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: I = None
        self.z: E = None
        self.t: I = None
        self.x: A = None
        self.y: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: G = None
        self.t: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: G = None
        self.w: B = None
        self.x: E = None
        self.s: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: J = None
        self.q: D = None
        self.x: C = None
        self.z: C = None
        self.v: E = None
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: J = None
        self.o: E = None
        self.t: J = None
        self.z: E = None
        self.u: H = None
        self.v: B = None
        self.p: A = None
        self.r: D = None
        self.y: J = 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.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: D = None
        self.y: A = None
        self.v: H = None
        self.p: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: I = None
        self.z: E = None
        self.t: I = None
        self.x: A = None
        self.y: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: G = None
        self.t: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: G = None
        self.w: B = None
        self.x: E = None
        self.s: H = None
        self.txt = txt

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

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