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

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

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

m = A("m")
l = B("l")
g = C("g")
d = C("d")
b = B("b")
k = C("k")
i = B("i")
a = C("a")
j = A("j")

m.v = j
m.o = g
l.u = d
l.s = d
l.x = a
g.t = m
g.q = b
g.y = l
d.t = m
d.q = l
d.y = l
b.u = g
b.x = a
b.s = d
k.t = j
k.q = l
k.y = i
i.u = g
i.x = k
i.s = a
a.t = m
a.q = b
a.y = l
j.v = m
j.o = g
assert g.t.v.v.v.o.y.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: C = None
        self.txt = txt

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

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

m = A("m")
l = B("l")
g = C("g")
d = C("d")
b = B("b")
k = C("k")
i = B("i")
a = C("a")
j = A("j")

m.v = j
m.o = g
l.u = d
l.s = d
l.x = a
g.t = m
g.q = b
g.y = l
d.t = m
d.q = l
d.y = l
b.u = g
b.x = a
b.s = d
k.t = j
k.q = l
k.y = i
i.u = g
i.x = k
i.s = a
a.t = m
a.q = b
a.y = l
j.v = m
j.o = g
assert g.t.v.v.v.o.y.x.txt == "a"