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

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

class C:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: C = None
        self.txt = txt

d = A("d")
i = B("i")
k = C("k")
f = B("f")
l = B("l")
e = A("e")
h = B("h")
b = C("b")
a = A("a")
c = C("c")

d.t = h
i.s = f
i.r = h
i.t = d
k.u = b
k.o = c
f.s = l
f.r = h
f.t = a
l.s = h
l.r = i
l.t = a
e.t = h
h.s = l
h.r = i
h.t = a
b.u = k
b.o = c
a.t = i
c.u = k
c.o = b
assert k.o.o.o.u.u.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: C = None
        self.txt = txt

d = A("d")
i = B("i")
k = C("k")
f = B("f")
l = B("l")
e = A("e")
h = B("h")
b = C("b")
a = A("a")
c = C("c")

d.t = h
i.s = f
i.r = h
i.t = d
k.u = b
k.o = c
f.s = l
f.r = h
f.t = a
l.s = h
l.r = i
l.t = a
e.t = h
h.s = l
h.r = i
h.t = a
b.u = k
b.o = c
a.t = i
c.u = k
c.o = b
assert k.o.o.o.u.u.u.u.txt == "b"