class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: C = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: C = None
        self.v: B = None
        self.t: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: G = None
        self.o: F = None
        self.s: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: A = None
        self.y: C = None
        self.txt = txt

k = A("k")
f = B("f")
i = C("i")
g = D("g")
n = E("n")
a = F("a")
h = G("h")
j = H("j")
m = B("m")
b = B("b")

k.x = n
k.y = i
k.v = g
f.r = k
f.q = i
f.v = b
f.t = g
i.p = b
i.u = h
i.o = a
i.s = g
g.w = j
n.y = h
a.v = k
h.t = a
h.p = m
j.s = g
j.u = k
j.y = i
m.r = k
m.q = i
m.v = f
m.t = g
b.r = k
b.q = i
b.v = m
b.t = g
assert m.q.s.w.y.p.r.y.o.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: C = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: C = None
        self.v: B = None
        self.t: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: G = None
        self.o: F = None
        self.s: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: A = None
        self.y: C = None
        self.txt = txt

k = A("k")
f = B("f")
i = C("i")
g = D("g")
n = E("n")
a = F("a")
h = G("h")
j = H("j")
m = B("m")
b = B("b")

k.x = n
k.y = i
k.v = g
f.r = k
f.q = i
f.v = b
f.t = g
i.p = b
i.u = h
i.o = a
i.s = g
g.w = j
n.y = h
a.v = k
h.t = a
h.p = m
j.s = g
j.u = k
j.y = i
m.r = k
m.q = i
m.v = f
m.t = g
b.r = k
b.q = i
b.v = m
b.t = g
assert m.q.s.w.y.p.r.y.o.v.v.txt == "g"