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

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

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

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

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

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

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

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

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

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

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

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

e.u = c
e.q = n
c.o = e
c.w = m
c.s = m
c.q = a
m.s = j
m.t = a
m.y = a
m.v = n
a.x = n
n.t = j
j.o = e
j.w = m
j.s = m
j.q = a
assert n.t.o.u.o.txt == "e"