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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: A = None
        self.s: D = None
        self.y: B = None
        self.txt = txt

n = A("n")
e = B("e")
m = C("m")
i = D("i")
b = E("b")
a = A("a")
d = C("d")
c = B("c")

n.r = d
n.v = e
n.s = a
e.s = c
e.x = c
e.r = m
e.w = a
e.t = b
m.w = n
m.r = n
m.v = b
m.o = d
i.o = n
i.x = e
b.v = i
b.s = i
b.q = a
b.y = c
a.r = d
a.v = e
a.s = n
d.w = n
d.v = b
d.o = m
d.r = a
c.s = e
c.x = e
c.r = d
c.w = n
c.t = b
assert a.r.w.s.s.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: B = None
        self.s: A = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: A = None
        self.s: D = None
        self.y: B = None
        self.txt = txt

n = A("n")
e = B("e")
m = C("m")
i = D("i")
b = E("b")
a = A("a")
d = C("d")
c = B("c")

n.r = d
n.v = e
n.s = a
e.s = c
e.x = c
e.r = m
e.w = a
e.t = b
m.w = n
m.r = n
m.v = b
m.o = d
i.o = n
i.x = e
b.v = i
b.s = i
b.q = a
b.y = c
a.r = d
a.v = e
a.s = n
d.w = n
d.v = b
d.o = m
d.r = a
c.s = e
c.x = e
c.r = d
c.w = n
c.t = b
assert a.r.w.s.s.s.s.txt == "n"