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

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

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: A = None
        self.x: H = None
        self.y: F = None
        self.r: E = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.w: G = None
        self.v: F = None
        self.y: F = None
        self.o: G = None
        self.u: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: C = None
        self.y: F = None
        self.z: C = None
        self.s: C = None
        self.p: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: A = None
        self.x: H = None
        self.y: F = None
        self.r: E = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.w: G = None
        self.v: F = None
        self.y: F = None
        self.o: G = None
        self.u: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: C = None
        self.y: F = None
        self.z: C = None
        self.s: C = None
        self.p: E = None
        self.txt = txt

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

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