class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: J = None
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: D = None
        self.u: J = None
        self.o: B = None
        self.r: B = None
        self.v: E = None
        self.s: H = None
        self.q: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.q: H = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: J = None
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: D = None
        self.u: J = None
        self.o: B = None
        self.r: B = None
        self.v: E = None
        self.s: H = None
        self.q: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.q: H = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: C = None
        self.txt = txt

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

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