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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: H = None
        self.w: G = None
        self.x: H = None
        self.r: C = None
        self.q: A = None
        self.t: H = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: C = None
        self.u: F = None
        self.z: I = None
        self.x: E = None
        self.t: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: C = None
        self.p: B = None
        self.u: H = None
        self.txt = txt

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

a.t = c
a.s = m
a.y = n
a.w = i
a.q = i
a.p = f
f.s = c
f.y = c
f.u = d
f.p = d
f.v = a
f.o = h
f.w = i
f.r = m
f.z = l
l.w = m
l.t = h
c.x = l
n.q = c
n.r = m
h.o = d
h.w = d
h.p = i
h.x = i
h.t = i
h.r = l
h.q = a
h.s = c
d.r = l
d.o = l
d.u = h
d.z = m
d.x = n
d.t = a
i.p = c
m.w = l
m.s = l
m.p = f
m.u = i
assert n.r.u.p.x.w.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: I = None
        self.y: E = None
        self.w: H = None
        self.q: H = None
        self.p: B = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: H = None
        self.w: G = None
        self.x: H = None
        self.r: C = None
        self.q: A = None
        self.t: H = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: C = None
        self.u: F = None
        self.z: I = None
        self.x: E = None
        self.t: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: C = None
        self.p: B = None
        self.u: H = None
        self.txt = txt

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

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