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

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

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

d = A("d")
b = B("b")
a = C("a")
c = B("c")
n = C("n")
m = A("m")
l = A("l")
g = B("g")
i = C("i")

d.o = i
d.y = b
d.t = n
b.u = c
b.s = c
b.z = m
a.s = n
a.o = l
a.x = b
c.u = b
c.s = g
c.z = d
n.s = a
n.o = d
n.x = g
m.o = i
m.t = i
m.y = c
l.o = n
l.y = b
l.t = i
g.u = b
g.s = b
g.z = m
i.s = n
i.o = l
i.x = b
assert m.y.u.u.z.o.s.o.y.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: B = None
        self.t: C = None
        self.txt = txt

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

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

d = A("d")
b = B("b")
a = C("a")
c = B("c")
n = C("n")
m = A("m")
l = A("l")
g = B("g")
i = C("i")

d.o = i
d.y = b
d.t = n
b.u = c
b.s = c
b.z = m
a.s = n
a.o = l
a.x = b
c.u = b
c.s = g
c.z = d
n.s = a
n.o = d
n.x = g
m.o = i
m.t = i
m.y = c
l.o = n
l.y = b
l.t = i
g.u = b
g.s = b
g.z = m
i.s = n
i.o = l
i.x = b
assert m.y.u.u.z.o.s.o.y.txt == "b"