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

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

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

e = A("e")
g = B("g")
f = C("f")
d = A("d")
k = B("k")
j = C("j")
n = A("n")
c = A("c")
h = B("h")

e.v = j
e.p = g
e.s = f
g.u = e
f.o = g
f.z = j
d.v = j
d.p = h
d.s = f
k.u = n
j.o = k
j.z = f
n.v = f
n.p = h
n.s = j
c.v = j
c.p = k
c.s = f
h.u = c
assert c.p.u.s.z.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: B = None
        self.s: C = None
        self.txt = txt

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

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

e = A("e")
g = B("g")
f = C("f")
d = A("d")
k = B("k")
j = C("j")
n = A("n")
c = A("c")
h = B("h")

e.v = j
e.p = g
e.s = f
g.u = e
f.o = g
f.z = j
d.v = j
d.p = h
d.s = f
k.u = n
j.o = k
j.z = f
n.v = f
n.p = h
n.s = j
c.v = j
c.p = k
c.s = f
h.u = c
assert c.p.u.s.z.o.u.txt == "e"