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

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

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

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

c.p = m
i.w = f
i.s = l
d.v = i
d.u = i
d.z = i
l.w = f
l.s = i
g.v = i
g.u = i
g.z = l
f.p = g
b.p = d
e.p = d
m.v = l
m.z = l
m.u = i
assert f.p.v.w.p.v.s.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

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

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

c.p = m
i.w = f
i.s = l
d.v = i
d.u = i
d.z = i
l.w = f
l.s = i
g.v = i
g.u = i
g.z = l
f.p = g
b.p = d
e.p = d
m.v = l
m.z = l
m.u = i
assert f.p.v.w.p.v.s.txt == "l"