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

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

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

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

i.z = h
i.s = b
i.q = b
h.v = e
h.r = c
k.y = b
k.q = b
k.w = n
j.v = e
j.r = h
l.v = i
l.r = c
c.v = d
c.r = h
e.z = h
e.s = b
e.q = k
n.v = e
n.r = l
b.y = k
b.q = k
b.w = c
d.z = n
d.s = b
d.q = k
assert h.v.s.w.r.v.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: C = None
        self.q: C = None
        self.txt = txt

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

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

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

i.z = h
i.s = b
i.q = b
h.v = e
h.r = c
k.y = b
k.q = b
k.w = n
j.v = e
j.r = h
l.v = i
l.r = c
c.v = d
c.r = h
e.z = h
e.s = b
e.q = k
n.v = e
n.r = l
b.y = k
b.q = k
b.w = c
d.z = n
d.s = b
d.q = k
assert h.v.s.w.r.v.q.q.txt == "b"