class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: C = None
        self.o: A = None
        self.x: A = None
        self.w: B = None
        self.txt = txt

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

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

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

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

e = A("e")
m = B("m")
k = C("k")
c = D("c")
i = E("i")
j = C("j")
l = A("l")

e.u = m
e.w = m
e.p = k
e.o = l
e.x = l
m.t = e
m.x = c
m.u = i
k.u = j
k.s = e
k.p = l
k.z = c
c.w = l
c.r = e
i.q = m
i.z = m
i.v = j
i.r = j
i.s = c
j.u = k
j.s = e
j.p = l
j.z = c
l.u = m
l.w = m
l.p = j
l.o = e
l.x = e
assert l.u.x.r.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: C = None
        self.o: A = None
        self.x: A = None
        self.w: B = None
        self.txt = txt

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

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

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

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

e = A("e")
m = B("m")
k = C("k")
c = D("c")
i = E("i")
j = C("j")
l = A("l")

e.u = m
e.w = m
e.p = k
e.o = l
e.x = l
m.t = e
m.x = c
m.u = i
k.u = j
k.s = e
k.p = l
k.z = c
c.w = l
c.r = e
i.q = m
i.z = m
i.v = j
i.r = j
i.s = c
j.u = k
j.s = e
j.p = l
j.z = c
l.u = m
l.w = m
l.p = j
l.o = e
l.x = e
assert l.u.x.r.txt == "e"