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

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

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

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

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

k = A("k")
a = B("a")
b = C("b")
e = D("e")
n = E("n")
i = C("i")

k.x = e
k.r = e
k.s = n
k.t = b
k.v = b
a.x = e
b.z = e
b.w = i
b.r = k
e.q = i
e.r = i
e.y = k
e.p = n
n.r = e
n.v = a
n.p = i
n.y = k
i.z = e
i.w = b
i.r = k
assert a.x.r.z.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: E = None
        self.t: C = None
        self.r: D = None
        self.v: C = None
        self.txt = txt

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

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

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

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

k = A("k")
a = B("a")
b = C("b")
e = D("e")
n = E("n")
i = C("i")

k.x = e
k.r = e
k.s = n
k.t = b
k.v = b
a.x = e
b.z = e
b.w = i
b.r = k
e.q = i
e.r = i
e.y = k
e.p = n
n.r = e
n.v = a
n.p = i
n.y = k
i.z = e
i.w = b
i.r = k
assert a.x.r.z.y.txt == "k"