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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

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

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

c.x = h
e.v = h
k.s = c
h.w = l
h.o = l
h.r = m
h.z = k
a.u = h
a.z = h
l.w = h
l.o = h
l.r = c
l.z = k
m.x = l
j.v = h
assert j.v.o.z.s.x.w.txt == "l"