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

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

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

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

a.w = g
a.s = d
a.v = i
l.q = i
h.x = g
h.t = e
n.q = i
d.x = g
d.t = e
j.q = g
i.w = a
i.v = a
i.s = b
b.x = a
b.t = h
e.x = i
e.t = h
g.w = i
g.v = i
g.s = b
assert a.s.t.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: C = None
        self.v: A = None
        self.txt = txt

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

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

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

a.w = g
a.s = d
a.v = i
l.q = i
h.x = g
h.t = e
n.q = i
d.x = g
d.t = e
j.q = g
i.w = a
i.v = a
i.s = b
b.x = a
b.t = h
e.x = i
e.t = h
g.w = i
g.v = i
g.s = b
assert a.s.t.t.t.txt == "e"