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

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

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

e = A("e")
f = B("f")
c = C("c")
k = C("k")
d = B("d")
g = B("g")
l = A("l")
a = C("a")
m = A("m")
h = B("h")

e.t = l
f.y = l
f.v = c
f.s = c
c.r = d
k.r = g
d.y = l
d.v = k
d.s = c
g.y = l
g.v = a
g.s = c
l.t = e
a.r = h
m.t = l
h.y = l
h.v = k
h.s = a
assert f.v.r.s.r.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

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

e = A("e")
f = B("f")
c = C("c")
k = C("k")
d = B("d")
g = B("g")
l = A("l")
a = C("a")
m = A("m")
h = B("h")

e.t = l
f.y = l
f.v = c
f.s = c
c.r = d
k.r = g
d.y = l
d.v = k
d.s = c
g.y = l
g.v = a
g.s = c
l.t = e
a.r = h
m.t = l
h.y = l
h.v = k
h.s = a
assert f.v.r.s.r.y.t.txt == "e"