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

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

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

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

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

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

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

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

d.w = l
d.v = b
a.t = l
a.v = l
m.u = k
h.t = b
h.v = b
i.u = c
c.u = m
b.t = a
b.v = f
f.t = l
f.v = l
k.u = i
l.t = h
l.v = a
assert i.u.u.u.u.u.u.u.u.txt == "i"