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

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

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

l = A("l")
h = B("h")
g = C("g")
b = C("b")
e = B("e")
d = A("d")
j = B("j")
c = C("c")
i = C("i")

l.z = d
l.y = c
l.o = i
h.s = l
h.x = d
g.t = b
g.v = d
b.t = g
b.v = d
e.s = l
e.x = d
d.z = l
d.y = c
d.o = c
j.s = d
j.x = l
c.t = b
c.v = l
i.t = g
i.v = d
assert b.v.z.y.t.t.v.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: C = None
        self.o: C = None
        self.txt = txt

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

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

l = A("l")
h = B("h")
g = C("g")
b = C("b")
e = B("e")
d = A("d")
j = B("j")
c = C("c")
i = C("i")

l.z = d
l.y = c
l.o = i
h.s = l
h.x = d
g.t = b
g.v = d
b.t = g
b.v = d
e.s = l
e.x = d
d.z = l
d.y = c
d.o = c
j.s = d
j.x = l
c.t = b
c.v = l
i.t = g
i.v = d
assert b.v.z.y.t.t.v.o.txt == "c"