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

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

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

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

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

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

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

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

d.q = g
d.v = g
g.y = b
g.o = b
g.s = h
e.y = d
e.z = g
n.y = d
n.z = g
b.y = d
b.z = h
j.y = d
j.z = g
i.y = d
i.z = g
c.q = h
c.v = h
h.y = b
h.s = g
h.o = i
assert i.y.v.y.z.s.o.txt == "b"