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

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

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

c = A("c")
i = B("i")
k = C("k")
l = A("l")
d = B("d")
a = A("a")
j = C("j")
b = C("b")
n = A("n")
e = B("e")

c.z = l
i.p = j
i.x = d
i.r = b
k.y = b
k.u = d
k.s = d
l.z = a
d.p = b
d.x = i
d.r = k
a.z = l
j.y = b
j.u = i
j.s = i
b.y = j
b.u = e
b.s = e
n.z = a
e.p = b
e.x = i
e.r = j
assert j.s.x.x.p.s.x.x.p.u.p.txt == "
class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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

c = A("c")
i = B("i")
k = C("k")
l = A("l")
d = B("d")
a = A("a")
j = C("j")
b = C("b")
n = A("n")
e = B("e")

c.z = l
i.p = j
i.x = d
i.r = b
k.y = b
k.u = d
k.s = d
l.z = a
d.p = b
d.x = i
d.r = k
a.z = l
j.y = b
j.u = i
j.s = i
b.y = j
b.u = e
b.s = e
n.z = a
e.p = b
e.x = i
e.r = j
assert j.s.x.x.p.s.x.x.p.u.p.txt == "j"