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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: C = None
        self.r: G = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: B = None
        self.x: C = None
        self.z: B = None
        self.y: H = None
        self.w: C = None
        self.txt = txt

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

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

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

f.z = e
f.r = k
d.q = f
d.r = e
d.z = h
d.v = l
d.p = c
k.w = c
k.z = n
l.t = e
l.w = f
l.r = f
l.y = h
l.p = h
l.u = k
l.z = n
l.s = c
e.x = k
e.u = k
e.r = h
e.q = h
n.u = d
n.p = d
n.z = d
n.x = k
n.w = k
n.y = c
h.y = d
h.r = d
c.s = l
assert k.w.s.z.w.w.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: C = None
        self.r: G = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: B = None
        self.x: C = None
        self.z: B = None
        self.y: H = None
        self.w: C = None
        self.txt = txt

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

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

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

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