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

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

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

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

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

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

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

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

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