class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: C = None
        self.t: F = None
        self.s: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.u: B = None
        self.x: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.q: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: C = None
        self.q: G = None
        self.t: C = None
        self.u: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: C = None
        self.y: B = None
        self.x: H = None
        self.r: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.u: B = None
        self.x: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.q: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: C = None
        self.q: G = None
        self.t: C = None
        self.u: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: C = None
        self.y: B = None
        self.x: H = None
        self.r: A = None
        self.txt = txt

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

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