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

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

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

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

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

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

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

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

h.t = i
h.s = e
k.t = e
k.x = j
l.x = j
l.w = a
l.y = h
n.x = j
n.w = g
n.y = h
i.x = g
i.w = g
i.y = h
a.t = h
a.x = j
g.t = h
g.x = k
e.t = l
e.s = h
j.t = h
j.x = g
assert l.y.t.x.t.t.txt == "i"