class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: C = None
        self.v: B = None
        self.q: D = None
        self.w: F = None
        self.txt = txt

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

m.u = l
m.z = f
l.q = c
l.o = d
l.r = m
f.t = m
a.s = k
a.r = k
a.t = k
a.o = f
n.y = l
n.r = f
c.q = l
c.w = f
d.y = n
d.o = a
d.u = m
d.w = f
k.u = f
k.t = f
k.v = l
k.q = a
k.w = c
assert m.u.o.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: C = None
        self.v: B = None
        self.q: D = None
        self.w: F = None
        self.txt = txt

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

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