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

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

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

g = A("g")
l = B("l")
h = C("h")
i = B("i")
n = C("n")
k = C("k")
m = C("m")
b = B("b")

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

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

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

g = A("g")
l = B("l")
h = C("h")
i = B("i")
n = C("n")
k = C("k")
m = C("m")
b = B("b")

g.u = i
g.o = k
l.s = i
h.x = b
h.v = l
h.y = m
i.s = l
n.x = i
n.v = l
n.y = h
k.x = l
k.v = l
k.y = n
m.x = i
m.v = l
m.y = n
b.s = l
assert m.y.x.s.s.s.s.s.txt == "l"