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

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

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

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

m = A("m")
b = B("b")
h = C("h")
g = D("g")
f = C("f")
n = A("n")
a = A("a")
j = A("j")
k = D("k")
i = B("i")

m.u = f
m.y = h
m.s = k
b.q = i
b.v = h
b.y = h
b.o = n
h.y = b
h.u = k
g.w = b
f.y = b
f.u = g
n.u = h
n.y = h
n.s = g
a.u = h
a.y = f
a.s = k
j.u = f
j.y = f
j.s = g
k.w = b
i.q = b
i.v = h
i.y = h
i.o = m
assert b.o.y.u.w.y.u.w.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: C = None
        self.s: D = None
        self.txt = txt

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

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

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

m = A("m")
b = B("b")
h = C("h")
g = D("g")
f = C("f")
n = A("n")
a = A("a")
j = A("j")
k = D("k")
i = B("i")

m.u = f
m.y = h
m.s = k
b.q = i
b.v = h
b.y = h
b.o = n
h.y = b
h.u = k
g.w = b
f.y = b
f.u = g
n.u = h
n.y = h
n.s = g
a.u = h
a.y = f
a.s = k
j.u = f
j.y = f
j.s = g
k.w = b
i.q = b
i.v = h
i.y = h
i.o = m
assert b.o.y.u.w.y.u.w.v.u.txt == "k"