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

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

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

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

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

e.s = j
e.w = h
e.o = f
e.v = l
g.s = b
g.z = j
g.u = h
g.v = k
k.t = f
k.z = g
l.p = h
n.p = b
j.t = k
j.z = b
b.s = g
b.u = g
b.z = k
b.v = f
h.s = g
h.u = g
h.z = k
h.v = f
f.t = j
f.z = b
i.p = g
assert k.z.z.z.z.t.t.z.z.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: B = None
        self.o: C = None
        self.v: D = None
        self.txt = txt

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

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

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

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

e.s = j
e.w = h
e.o = f
e.v = l
g.s = b
g.z = j
g.u = h
g.v = k
k.t = f
k.z = g
l.p = h
n.p = b
j.t = k
j.z = b
b.s = g
b.u = g
b.z = k
b.v = f
h.s = g
h.u = g
h.z = k
h.v = f
f.t = j
f.z = b
i.p = g
assert k.z.z.z.z.t.t.z.z.z.z.txt == "j"