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

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

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

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

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

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

i.p = f
i.v = m
m.s = b
m.z = g
c.p = j
c.v = k
n.p = f
n.v = m
b.p = c
b.v = g
e.p = i
e.v = k
f.p = i
f.v = g
k.s = c
k.z = m
g.s = i
g.z = k
j.p = i
j.v = g
assert g.z.s.p.p.p.p.v.s.txt == "b"