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

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

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

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: C = None
        self.s: B = None
        self.x: F = None
        self.v: F = None
        self.o: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: H = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: C = None
        self.s: B = None
        self.x: F = None
        self.v: F = None
        self.o: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: H = None
        self.txt = txt

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

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

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

m.u = k
m.z = f
l.t = m
l.u = k
e.p = l
e.y = f
e.t = f
e.w = m
e.q = a
e.v = h
e.u = k
e.s = c
a.r = k
a.o = k
a.u = e
a.s = l
a.x = f
a.v = f
h.z = f
h.p = k
f.z = a
f.s = c
k.w = m
c.w = k
c.o = k
c.r = h
assert k.w.z.s.r.txt == "h"