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

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

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

l = A("l")
h = B("h")
c = C("c")
g = A("g")
a = C("a")
j = A("j")
f = C("f")
n = C("n")

l.w = j
l.t = j
h.s = j
c.o = l
c.q = n
c.w = a
g.w = j
g.t = l
a.o = j
a.q = c
a.w = c
j.w = l
j.t = g
f.o = j
f.q = a
f.w = n
n.o = j
n.q = f
n.w = c
assert h.s.t.t.w.w.w.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: A = None
        self.txt = txt

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

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

l = A("l")
h = B("h")
c = C("c")
g = A("g")
a = C("a")
j = A("j")
f = C("f")
n = C("n")

l.w = j
l.t = j
h.s = j
c.o = l
c.q = n
c.w = a
g.w = j
g.t = l
a.o = j
a.q = c
a.w = c
j.w = l
j.t = g
f.o = j
f.q = a
f.w = n
n.o = j
n.q = f
n.w = c
assert h.s.t.t.w.w.w.t.txt == "g"