class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: C = None
        self.z: F = None
        self.t: C = None
        self.p: C = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: C = None
        self.t: A = None
        self.u: A = None
        self.r: B = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: C = None
        self.t: A = None
        self.u: A = None
        self.r: B = None
        self.txt = txt

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

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

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

e.v = l
e.r = h
e.t = h
e.p = h
e.u = h
e.z = n
d.p = k
d.s = e
h.v = n
k.v = d
k.r = d
k.p = h
k.t = e
k.u = e
l.w = d
n.p = k
n.z = d
assert d.s.z.z.s.z.p.txt == "k"