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

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

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

i = A("i")
d = B("d")
b = C("b")
a = C("a")
e = C("e")
c = B("c")
j = A("j")
k = B("k")
h = B("h")
f = B("f")

i.z = j
i.s = j
i.u = b
d.y = j
d.p = j
d.t = e
b.q = i
a.q = j
e.q = j
c.y = i
c.p = i
c.t = b
j.z = i
j.s = i
j.u = e
k.y = j
k.p = i
k.t = b
h.y = j
h.p = i
h.t = e
f.y = i
f.p = j
f.t = e
assert d.y.z.s.z.s.z.u.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: C = None
        self.s: A = None
        self.txt = txt

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

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

i = A("i")
d = B("d")
b = C("b")
a = C("a")
e = C("e")
c = B("c")
j = A("j")
k = B("k")
h = B("h")
f = B("f")

i.z = j
i.s = j
i.u = b
d.y = j
d.p = j
d.t = e
b.q = i
a.q = j
e.q = j
c.y = i
c.p = i
c.t = b
j.z = i
j.s = i
j.u = e
k.y = j
k.p = i
k.t = b
h.y = j
h.p = i
h.t = e
f.y = i
f.p = j
f.t = e
assert d.y.z.s.z.s.z.u.q.u.txt == "b"