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

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

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

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

a.y = b
a.z = k
a.v = k
h.r = f
g.t = f
g.s = b
g.w = l
m.t = l
m.s = a
m.w = j
f.r = j
k.y = a
k.v = a
k.z = b
j.r = h
i.t = h
i.s = a
i.w = j
l.r = h
b.y = a
b.z = k
b.v = k
assert a.v.z.v.y.y.v.z.z.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: A = None
        self.v: A = None
        self.txt = txt

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

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

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

a.y = b
a.z = k
a.v = k
h.r = f
g.t = f
g.s = b
g.w = l
m.t = l
m.s = a
m.w = j
f.r = j
k.y = a
k.v = a
k.z = b
j.r = h
i.t = h
i.s = a
i.w = j
l.r = h
b.y = a
b.z = k
b.v = k
assert a.v.z.v.y.y.v.z.z.y.y.txt == "b"