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

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

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

k = A("k")
e = B("e")
i = C("i")
n = C("n")
g = C("g")
a = A("a")

k.s = a
k.x = a
k.p = e
e.s = g
e.o = n
e.y = i
i.u = k
n.u = k
g.u = a
a.s = k
a.x = k
a.p = e
assert i.u.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: B = None
        self.x: A = None
        self.txt = txt

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

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

k = A("k")
e = B("e")
i = C("i")
n = C("n")
g = C("g")
a = A("a")

k.s = a
k.x = a
k.p = e
e.s = g
e.o = n
e.y = i
i.u = k
n.u = k
g.u = a
a.s = k
a.x = k
a.p = e
assert i.u.s.p.txt == "e"