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

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

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

i = A("i")
j = B("j")
c = C("c")
e = A("e")
b = B("b")
f = C("f")
m = C("m")
n = B("n")
g = A("g")
l = C("l")

i.w = b
j.p = f
j.u = c
c.o = l
c.s = j
e.w = b
b.p = f
b.u = l
f.o = c
f.s = n
m.o = l
m.s = n
n.p = f
n.u = l
g.w = j
l.o = f
l.s = b
assert l.o.s.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

i = A("i")
j = B("j")
c = C("c")
e = A("e")
b = B("b")
f = C("f")
m = C("m")
n = B("n")
g = A("g")
l = C("l")

i.w = b
j.p = f
j.u = c
c.o = l
c.s = j
e.w = b
b.p = f
b.u = l
f.o = c
f.s = n
m.o = l
m.s = n
n.p = f
n.u = l
g.w = j
l.o = f
l.s = b
assert l.o.s.u.txt == "l"