class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: I = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: H = None
        self.y: H = None
        self.x: H = None
        self.t: E = None
        self.q: H = None
        self.s: F = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.v: G = None
        self.o: B = None
        self.s: F = None
        self.z: D = None
        self.t: F = None
        self.x: E = None
        self.p: G = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: H = None
        self.y: H = None
        self.x: H = None
        self.t: E = None
        self.q: H = None
        self.s: F = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.v: G = None
        self.o: B = None
        self.s: F = None
        self.z: D = None
        self.t: F = None
        self.x: E = None
        self.p: G = None
        self.txt = txt

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

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

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