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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

k = A("k")
m = B("m")
f = C("f")
e = D("e")
l = E("l")
a = D("a")
c = B("c")

k.y = c
m.t = c
m.y = k
m.v = k
m.r = f
f.p = e
e.w = k
e.r = f
e.x = a
e.o = a
e.t = l
l.y = k
l.z = f
l.p = e
a.w = k
a.r = f
a.x = e
a.o = e
a.t = l
c.t = m
c.y = k
c.v = k
c.r = f
assert k.y.r.p.t.z.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

k = A("k")
m = B("m")
f = C("f")
e = D("e")
l = E("l")
a = D("a")
c = B("c")

k.y = c
m.t = c
m.y = k
m.v = k
m.r = f
f.p = e
e.w = k
e.r = f
e.x = a
e.o = a
e.t = l
l.y = k
l.z = f
l.p = e
a.w = k
a.r = f
a.x = e
a.o = e
a.t = l
c.t = m
c.y = k
c.v = k
c.r = f
assert k.y.r.p.t.z.txt == "f"