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

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

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

k = A("k")
g = B("g")
j = C("j")
m = C("m")
f = C("f")
h = A("h")
d = B("d")
i = C("i")

k.t = d
k.q = h
k.y = h
g.y = h
j.w = f
j.s = k
j.u = k
m.w = i
m.s = k
m.u = k
f.w = j
f.s = h
f.u = h
h.t = d
h.q = k
h.y = k
d.y = k
i.w = m
i.s = k
i.u = k
assert h.y.t.y.t.y.q.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: A = None
        self.y: A = None
        self.txt = txt

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

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

k = A("k")
g = B("g")
j = C("j")
m = C("m")
f = C("f")
h = A("h")
d = B("d")
i = C("i")

k.t = d
k.q = h
k.y = h
g.y = h
j.w = f
j.s = k
j.u = k
m.w = i
m.s = k
m.u = k
f.w = j
f.s = h
f.u = h
h.t = d
h.q = k
h.y = k
d.y = k
i.w = m
i.s = k
i.u = k
assert h.y.t.y.t.y.q.y.t.txt == "d"