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

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.z: D = None
        self.x: E = None
        self.y: C = None
        self.p: G = None
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: A = None
        self.t: D = None
        self.x: E = None
        self.v: D = None
        self.w: F = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: D = None
        self.q: C = None
        self.w: C = None
        self.z: B = None
        self.o: F = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.z: D = None
        self.x: E = None
        self.y: C = None
        self.p: G = None
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: A = None
        self.t: D = None
        self.x: E = None
        self.v: D = None
        self.w: F = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: D = None
        self.q: C = None
        self.w: C = None
        self.z: B = None
        self.o: F = None
        self.txt = txt

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

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

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

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

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