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

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

k = A("k")
i = B("i")
c = C("c")
l = D("l")
f = E("f")

k.r = f
k.u = l
k.t = l
i.t = l
i.u = f
c.x = l
c.y = i
l.z = f
l.u = f
l.w = f
l.t = k
l.o = c
f.s = c
assert c.x.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: D = None
        self.t: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

k = A("k")
i = B("i")
c = C("c")
l = D("l")
f = E("f")

k.r = f
k.u = l
k.t = l
i.t = l
i.u = f
c.x = l
c.y = i
l.z = f
l.u = f
l.w = f
l.t = k
l.o = c
f.s = c
assert c.x.t.t.txt == "l"