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

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

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: C = None
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: A = None
        self.txt = txt

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

c.t = f
c.p = f
c.o = e
c.y = a
k.v = c
k.y = n
k.o = f
f.z = c
e.q = c
e.o = f
e.r = f
a.z = n
a.o = c
n.v = c
n.y = k
n.o = f
assert n.o.z.y.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: D = None
        self.y: E = None
        self.p: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: C = None
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: A = None
        self.txt = txt

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

c.t = f
c.p = f
c.o = e
c.y = a
k.v = c
k.y = n
k.o = f
f.z = c
e.q = c
e.o = f
e.r = f
a.z = n
a.o = c
n.v = c
n.y = k
n.o = f
assert n.o.z.y.z.txt == "n"