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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: D = None
        self.w: A = None
        self.t: A = None
        self.txt = txt

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

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

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

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

n.r = e
n.t = a
n.x = a
n.s = d
a.q = j
a.r = j
a.w = n
a.t = n
e.v = d
j.s = d
j.z = n
j.u = a
d.o = e
d.y = n
assert d.o.v.o.v.y.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: B = None
        self.x: B = None
        self.s: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: D = None
        self.w: A = None
        self.t: A = None
        self.txt = txt

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

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

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

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

n.r = e
n.t = a
n.x = a
n.s = d
a.q = j
a.r = j
a.w = n
a.t = n
e.v = d
j.s = d
j.z = n
j.u = a
d.o = e
d.y = n
assert d.o.v.o.v.y.txt == "n"