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

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

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

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

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

e = A("e")
j = B("j")
b = C("b")
k = D("k")
m = E("m")
d = B("d")
l = B("l")

e.u = k
j.r = d
j.w = e
b.t = d
b.v = d
b.z = m
b.w = m
b.r = k
k.z = m
k.x = l
k.y = e
k.s = e
m.u = j
m.z = k
d.r = j
d.w = e
l.r = d
l.w = e
assert l.r.r.r.w.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

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

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

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

e = A("e")
j = B("j")
b = C("b")
k = D("k")
m = E("m")
d = B("d")
l = B("l")

e.u = k
j.r = d
j.w = e
b.t = d
b.v = d
b.z = m
b.w = m
b.r = k
k.z = m
k.x = l
k.y = e
k.s = e
m.u = j
m.z = k
d.r = j
d.w = e
l.r = d
l.w = e
assert l.r.r.r.w.u.z.txt == "m"