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

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

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

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

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

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

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

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

l.y = b
b.w = d
b.t = n
k.x = b
k.v = c
k.w = d
h.x = a
h.v = f
h.w = d
a.w = d
a.t = b
f.x = b
f.v = k
f.w = l
d.y = a
c.x = n
c.v = k
c.w = d
i.x = b
i.v = k
i.w = d
n.w = d
n.t = b
assert c.x.w.y.t.t.w.y.w.y.txt == "a"