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

class B:
    def __init__(self, txt: str):
        self.p: B = None
        self.r: B = None
        self.y: E = None
        self.u: D = None
        self.v: D = None
        self.txt = txt

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

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

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

a = A("a")
m = B("m")
h = C("h")
k = D("k")
d = E("d")
j = D("j")
l = B("l")

a.x = d
a.z = j
m.p = l
m.r = l
m.y = d
m.u = k
m.v = j
h.o = a
h.r = d
h.s = l
k.r = j
k.u = l
k.z = d
d.z = m
d.w = h
j.r = k
j.u = m
j.z = d
l.p = m
l.r = m
l.y = d
l.u = k
l.v = k
assert k.r.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: B = None
        self.r: B = None
        self.y: E = None
        self.u: D = None
        self.v: D = None
        self.txt = txt

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

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

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

a = A("a")
m = B("m")
h = C("h")
k = D("k")
d = E("d")
j = D("j")
l = B("l")

a.x = d
a.z = j
m.p = l
m.r = l
m.y = d
m.u = k
m.v = j
h.o = a
h.r = d
h.s = l
k.r = j
k.u = l
k.z = d
d.z = m
d.w = h
j.r = k
j.u = m
j.z = d
l.p = m
l.r = m
l.y = d
l.u = k
l.v = k
assert k.r.r.u.txt == "l"