class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: B = None
        self.z: D = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: D = None
        self.w: A = None
        self.t: C = None
        self.s: C = None
        self.txt = txt

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

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

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

k = A("k")
n = B("n")
a = C("a")
l = D("l")
d = E("d")
f = C("f")

k.p = d
k.v = n
k.z = l
k.w = f
n.o = f
n.t = f
n.y = l
n.w = k
n.s = a
a.x = k
a.t = k
a.v = l
a.o = l
a.z = d
l.z = k
l.t = f
d.q = n
f.x = k
f.t = k
f.v = l
f.o = l
f.z = d
assert k.p.q.y.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: B = None
        self.z: D = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: D = None
        self.w: A = None
        self.t: C = None
        self.s: C = None
        self.txt = txt

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

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

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

k = A("k")
n = B("n")
a = C("a")
l = D("l")
d = E("d")
f = C("f")

k.p = d
k.v = n
k.z = l
k.w = f
n.o = f
n.t = f
n.y = l
n.w = k
n.s = a
a.x = k
a.t = k
a.v = l
a.o = l
a.z = d
l.z = k
l.t = f
d.q = n
f.x = k
f.t = k
f.v = l
f.o = l
f.z = d
assert k.p.q.y.z.z.txt == "l"