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

class B:
    def __init__(self, txt: str):
        self.v: H = None
        self.s: F = None
        self.w: F = None
        self.x: E = None
        self.r: H = None
        self.z: D = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: C = None
        self.w: G = None
        self.p: G = None
        self.x: H = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: H = None
        self.s: F = None
        self.w: F = None
        self.x: E = None
        self.r: H = None
        self.z: D = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: C = None
        self.w: G = None
        self.p: G = None
        self.x: H = None
        self.txt = txt

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

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

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

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

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

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