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

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

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

j = A("j")
g = B("g")
e = C("e")
b = C("b")
m = C("m")
n = C("n")
k = B("k")
d = B("d")
f = C("f")
l = A("l")

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

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

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

j = A("j")
g = B("g")
e = C("e")
b = C("b")
m = C("m")
n = C("n")
k = B("k")
d = B("d")
f = C("f")
l = A("l")

j.u = l
j.s = k
g.z = l
g.o = l
e.x = b
e.z = b
e.y = j
b.x = e
b.y = j
b.z = f
m.x = b
m.z = b
m.y = j
n.x = f
n.z = f
n.y = j
k.z = l
k.o = j
d.z = j
d.o = j
f.x = m
f.y = l
f.z = e
l.u = j
l.s = g
assert d.o.s.z.u.s.o.u.s.o.u.txt == "j"