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

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.w: G = None
        self.v: A = None
        self.t: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: E = None
        self.y: H = None
        self.q: H = None
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: D = None
        self.z: H = None
        self.t: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: F = None
        self.o: H = None
        self.u: C = None
        self.y: E = None
        self.v: E = None
        self.q: A = None
        self.txt = txt

a = A("a")
m = B("m")
l = C("l")
b = D("b")
h = E("h")
c = F("c")
d = G("d")
e = H("e")
n = I("n")
k = C("k")

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

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.w: G = None
        self.v: A = None
        self.t: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: E = None
        self.y: H = None
        self.q: H = None
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: D = None
        self.z: H = None
        self.t: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: F = None
        self.o: H = None
        self.u: C = None
        self.y: E = None
        self.v: E = None
        self.q: A = None
        self.txt = txt

a = A("a")
m = B("m")
l = C("l")
b = D("b")
h = E("h")
c = F("c")
d = G("d")
e = H("e")
n = I("n")
k = C("k")

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