class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: D = None
        self.y: D = None
        self.p: B = None
        self.w: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

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

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

k.o = f
k.z = f
k.y = f
k.w = f
k.p = g
g.w = f
g.z = f
g.o = n
g.y = k
g.p = k
n.x = k
f.t = l
f.p = k
l.u = f
l.v = f
l.y = k
l.z = n
l.s = g
assert l.z.x.y.p.txt == "k"