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

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

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

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

l.x = g
l.z = k
l.t = j
j.x = n
j.w = n
j.u = k
e.s = i
e.y = g
e.v = l
k.x = i
k.w = i
k.u = j
i.s = n
i.y = g
i.v = l
n.s = e
n.y = g
n.v = l
g.x = l
g.z = k
g.t = k
assert n.s.y.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: B = None
        self.t: B = None
        self.txt = txt

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

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

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

l.x = g
l.z = k
l.t = j
j.x = n
j.w = n
j.u = k
e.s = i
e.y = g
e.v = l
k.x = i
k.w = i
k.u = j
i.s = n
i.y = g
i.v = l
n.s = e
n.y = g
n.v = l
g.x = l
g.z = k
g.t = k
assert n.s.y.x.txt == "l"