class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: G = None
        self.x: D = None
        self.w: C = None
        self.z: H = None
        self.o: E = None
        self.u: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: G = None
        self.x: D = None
        self.w: C = None
        self.z: H = None
        self.o: E = None
        self.u: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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

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