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

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

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

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

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

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

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

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

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

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

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

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

e.r = k
e.z = k
e.o = d
c.o = a
c.x = k
c.u = d
d.v = c
k.p = e
k.r = d
k.q = a
k.x = c
k.z = c
a.w = c
a.r = c
a.v = d
a.t = d
n.r = k
n.z = k
n.o = d
assert e.o.v.x.txt == "k"