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

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

class C:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: B = None
        self.z: C = None
        self.v: C = None
        self.txt = txt

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

h = A("h")
d = B("d")
m = C("m")
l = D("l")
n = A("n")
e = B("e")
i = B("i")
k = C("k")

h.u = k
h.r = d
d.x = l
d.o = l
m.u = k
m.z = k
m.v = k
m.y = d
l.v = k
l.o = d
n.u = m
n.r = e
e.x = l
e.o = l
i.x = l
i.o = l
k.u = m
k.z = m
k.v = m
k.y = i
assert l.v.y.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: B = None
        self.z: C = None
        self.v: C = None
        self.txt = txt

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

h = A("h")
d = B("d")
m = C("m")
l = D("l")
n = A("n")
e = B("e")
i = B("i")
k = C("k")

h.u = k
h.r = d
d.x = l
d.o = l
m.u = k
m.z = k
m.v = k
m.y = d
l.v = k
l.o = d
n.u = m
n.r = e
e.x = l
e.o = l
i.x = l
i.o = l
k.u = m
k.z = m
k.v = m
k.y = i
assert l.v.y.o.v.txt == "k"