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

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

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

b = A("b")
g = B("g")
h = C("h")
l = A("l")
i = C("i")
c = B("c")
a = C("a")
m = A("m")

b.t = h
b.o = h
b.q = g
g.y = h
g.v = l
g.t = c
h.y = m
l.t = i
l.o = i
l.q = c
i.y = l
c.y = a
c.v = l
c.t = g
a.y = b
m.t = a
m.q = c
m.o = h
assert i.y.q.t.t.y.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: B = None
        self.o: C = None
        self.txt = txt

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

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

b = A("b")
g = B("g")
h = C("h")
l = A("l")
i = C("i")
c = B("c")
a = C("a")
m = A("m")

b.t = h
b.o = h
b.q = g
g.y = h
g.v = l
g.t = c
h.y = m
l.t = i
l.o = i
l.q = c
i.y = l
c.y = a
c.v = l
c.t = g
a.y = b
m.t = a
m.q = c
m.o = h
assert i.y.q.t.t.y.y.t.txt == "h"