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

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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