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

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

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

l = A("l")
d = B("d")
j = C("j")
b = A("b")
c = C("c")
k = A("k")
g = C("g")
i = B("i")
n = A("n")
f = C("f")

l.y = j
l.z = g
l.s = i
d.x = k
j.u = d
j.x = d
j.w = b
b.y = g
b.z = f
b.s = d
c.u = d
c.w = n
c.x = i
k.y = c
k.z = j
k.s = i
g.u = d
g.w = l
g.x = i
i.x = b
n.y = f
n.z = j
n.s = d
f.u = d
f.w = k
f.x = i
assert n.y.u.x.y.x.x.s.x.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: C = None
        self.s: B = None
        self.txt = txt

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

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

l = A("l")
d = B("d")
j = C("j")
b = A("b")
c = C("c")
k = A("k")
g = C("g")
i = B("i")
n = A("n")
f = C("f")

l.y = j
l.z = g
l.s = i
d.x = k
j.u = d
j.x = d
j.w = b
b.y = g
b.z = f
b.s = d
c.u = d
c.w = n
c.x = i
k.y = c
k.z = j
k.s = i
g.u = d
g.w = l
g.x = i
i.x = b
n.y = f
n.z = j
n.s = d
f.u = d
f.w = k
f.x = i
assert n.y.u.x.y.x.x.s.x.txt == "k"