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

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

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

d = A("d")
g = B("g")
i = C("i")
m = C("m")
a = B("a")
h = C("h")
f = C("f")
b = C("b")
n = A("n")
l = A("l")

d.u = n
d.y = l
d.q = g
g.u = n
g.r = a
g.t = d
i.s = f
i.z = g
m.s = f
m.z = g
a.u = n
a.r = g
a.t = d
h.s = m
h.z = g
f.s = h
f.z = g
b.s = i
b.z = g
n.u = l
n.y = d
n.q = g
l.u = d
l.y = n
l.q = a
assert d.q.t.y.q.u.u.q.u.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: A = None
        self.q: B = None
        self.txt = txt

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

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

d = A("d")
g = B("g")
i = C("i")
m = C("m")
a = B("a")
h = C("h")
f = C("f")
b = C("b")
n = A("n")
l = A("l")

d.u = n
d.y = l
d.q = g
g.u = n
g.r = a
g.t = d
i.s = f
i.z = g
m.s = f
m.z = g
a.u = n
a.r = g
a.t = d
h.s = m
h.z = g
f.s = h
f.z = g
b.s = i
b.z = g
n.u = l
n.y = d
n.q = g
l.u = d
l.y = n
l.q = a
assert d.q.t.y.q.u.u.q.u.q.txt == "g"