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

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

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

n = A("n")
b = B("b")
c = C("c")
m = A("m")
d = B("d")
k = A("k")
f = C("f")
l = A("l")
a = B("a")
h = C("h")

n.x = f
b.z = f
b.s = f
b.v = a
c.o = a
c.t = a
c.y = d
m.x = c
d.z = h
d.s = h
d.v = a
k.x = f
f.o = d
f.y = d
f.t = b
l.x = h
a.z = f
a.s = h
a.v = b
h.o = b
h.y = d
h.t = d
assert h.o.v.v.v.s.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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

n = A("n")
b = B("b")
c = C("c")
m = A("m")
d = B("d")
k = A("k")
f = C("f")
l = A("l")
a = B("a")
h = C("h")

n.x = f
b.z = f
b.s = f
b.v = a
c.o = a
c.t = a
c.y = d
m.x = c
d.z = h
d.s = h
d.v = a
k.x = f
f.o = d
f.y = d
f.t = b
l.x = h
a.z = f
a.s = h
a.v = b
h.o = b
h.y = d
h.t = d
assert h.o.v.v.v.s.txt == "h"