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

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

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

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

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

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

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

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

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

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

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

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

c.s = i
c.t = i
c.u = k
c.o = a
f.r = k
f.x = k
k.y = a
k.p = a
k.z = c
b.p = a
b.x = c
b.t = k
b.z = f
i.t = a
a.p = b
a.x = c
a.t = k
a.z = f
assert k.z.t.t.t.txt == "k"