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

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: D = None
        self.txt = txt

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

e = A("e")
f = B("f")
d = C("d")
g = D("g")
n = C("n")
i = B("i")
h = D("h")
k = D("k")
c = A("c")
b = B("b")

e.v = d
e.u = c
f.s = e
f.t = h
d.z = i
d.y = k
g.t = k
n.z = b
n.y = h
i.s = e
i.t = g
h.t = g
k.t = h
c.v = d
c.u = e
b.s = e
b.t = k
assert k.t.t.t.t.t.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: D = None
        self.txt = txt

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

e = A("e")
f = B("f")
d = C("d")
g = D("g")
n = C("n")
i = B("i")
h = D("h")
k = D("k")
c = A("c")
b = B("b")

e.v = d
e.u = c
f.s = e
f.t = h
d.z = i
d.y = k
g.t = k
n.z = b
n.y = h
i.s = e
i.t = g
h.t = g
k.t = h
c.v = d
c.u = e
b.s = e
b.t = k
assert k.t.t.t.t.t.t.t.txt == "h"