class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: I = None
        self.v: F = None
        self.q: B = None
        self.p: F = None
        self.o: F = None
        self.y: E = None
        self.t: E = None
        self.s: B = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: G = None
        self.x: C = None
        self.y: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: I = None
        self.v: F = None
        self.q: B = None
        self.p: F = None
        self.o: F = None
        self.y: E = None
        self.t: E = None
        self.s: B = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: G = None
        self.x: C = None
        self.y: H = None
        self.txt = txt

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

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