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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.y: D = None
        self.u: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.y: D = None
        self.u: D = None
        self.txt = txt

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

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

f.y = m
f.u = c
c.u = k
c.z = a
m.y = h
h.z = m
l.z = k
l.w = a
a.z = l
a.t = f
d.o = k
d.y = h
d.u = h
k.w = c
k.t = l
k.x = d
k.s = a
assert l.z.t.z.txt == "k"