class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: F = None
        self.q: F = None
        self.o: G = None
        self.r: E = None
        self.z: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: G = None
        self.w: G = None
        self.s: A = None
        self.p: B = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: H = None
        self.u: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: D = None
        self.p: E = None
        self.s: H = None
        self.x: B = None
        self.w: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: F = None
        self.y: D = None
        self.o: F = None
        self.v: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: G = None
        self.w: G = None
        self.s: A = None
        self.p: B = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: H = None
        self.u: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: D = None
        self.p: E = None
        self.s: H = None
        self.x: B = None
        self.w: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: F = None
        self.y: D = None
        self.o: F = None
        self.v: F = None
        self.txt = txt

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

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