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

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

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

c = A("c")
i = B("i")
f = C("f")
k = A("k")
g = C("g")
l = C("l")
a = C("a")

c.z = k
c.p = i
c.x = i
i.v = k
f.s = c
f.p = g
f.o = i
k.z = c
k.p = i
k.x = i
g.s = c
g.p = f
g.o = i
l.s = c
l.p = a
l.o = i
a.s = k
a.p = f
a.o = i
assert a.o.v.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: B = None
        self.x: B = None
        self.txt = txt

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

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

c = A("c")
i = B("i")
f = C("f")
k = A("k")
g = C("g")
l = C("l")
a = C("a")

c.z = k
c.p = i
c.x = i
i.v = k
f.s = c
f.p = g
f.o = i
k.z = c
k.p = i
k.x = i
g.s = c
g.p = f
g.o = i
l.s = c
l.p = a
l.o = i
a.s = k
a.p = f
a.o = i
assert a.o.v.z.z.txt == "k"