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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.z: F = None
        self.r: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: A = None
        self.o: H = None
        self.s: C = None
        self.r: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: H = None
        self.s: E = None
        self.q: B = None
        self.w: C = None
        self.txt = txt

l = A("l")
e = B("e")
k = C("k")
j = D("j")
f = E("f")
c = F("c")
a = G("a")
g = H("g")
n = H("n")

l.r = j
e.v = a
e.o = f
k.r = j
k.w = j
j.z = c
j.p = f
f.v = a
f.z = c
f.r = e
c.y = k
c.z = j
a.t = e
a.v = l
a.o = g
a.s = k
a.r = c
g.o = n
g.s = f
g.q = e
g.w = k
n.o = g
n.s = f
n.q = e
n.w = k
assert k.w.z.z.z.y.w.z.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.z: F = None
        self.r: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: A = None
        self.o: H = None
        self.s: C = None
        self.r: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: H = None
        self.s: E = None
        self.q: B = None
        self.w: C = None
        self.txt = txt

l = A("l")
e = B("e")
k = C("k")
j = D("j")
f = E("f")
c = F("c")
a = G("a")
g = H("g")
n = H("n")

l.r = j
e.v = a
e.o = f
k.r = j
k.w = j
j.z = c
j.p = f
f.v = a
f.z = c
f.r = e
c.y = k
c.z = j
a.t = e
a.v = l
a.o = g
a.s = k
a.r = c
g.o = n
g.s = f
g.q = e
g.w = k
n.o = g
n.s = f
n.q = e
n.w = k
assert k.w.z.z.z.y.w.z.txt == "c"