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

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

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

i = A("i")
l = B("l")
n = C("n")
j = B("j")
k = C("k")
e = C("e")

i.x = l
l.z = j
l.p = i
l.r = i
n.t = j
n.x = j
j.z = l
j.p = i
j.r = i
k.t = l
k.x = j
e.t = j
e.x = j
assert n.x.r.x.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

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

i = A("i")
l = B("l")
n = C("n")
j = B("j")
k = C("k")
e = C("e")

i.x = l
l.z = j
l.p = i
l.r = i
n.t = j
n.x = j
j.z = l
j.p = i
j.r = i
k.t = l
k.x = j
e.t = j
e.x = j
assert n.x.r.x.z.z.txt == "l"