class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: B = None
        self.y: C = None
        self.z: B = None
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: H = None
        self.v: H = None
        self.o: F = None
        self.t: F = None
        self.z: D = None
        self.p: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.w: B = None
        self.y: F = None
        self.t: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: D = None
        self.z: B = None
        self.w: C = None
        self.o: B = None
        self.q: D = None
        self.p: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: F = None
        self.v: G = None
        self.w: D = None
        self.y: A = None
        self.x: G = None
        self.txt = txt

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

b.r = k
b.s = k
b.q = j
b.z = j
b.y = m
a.r = k
a.o = k
a.t = k
a.p = k
a.s = n
a.v = f
a.z = i
m.v = f
i.v = f
i.w = a
i.y = k
i.t = j
d.v = e
d.t = n
d.z = k
k.r = j
e.v = d
e.y = i
e.q = i
e.z = a
e.w = m
e.o = j
e.p = k
n.r = b
n.y = b
n.s = k
n.v = e
n.x = e
n.w = i
j.r = k
j.o = k
j.t = k
j.p = k
j.s = f
j.v = n
j.z = i
f.r = b
f.y = b
f.s = k
f.v = e
f.x = e
f.w = i
assert f.y.y.v.v.v.v.q.v.r.z.txt == "
class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: B = None
        self.y: C = None
        self.z: B = None
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: H = None
        self.v: H = None
        self.o: F = None
        self.t: F = None
        self.z: D = None
        self.p: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.w: B = None
        self.y: F = None
        self.t: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: D = None
        self.z: B = None
        self.w: C = None
        self.o: B = None
        self.q: D = None
        self.p: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: F = None
        self.v: G = None
        self.w: D = None
        self.y: A = None
        self.x: G = None
        self.txt = txt

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

b.r = k
b.s = k
b.q = j
b.z = j
b.y = m
a.r = k
a.o = k
a.t = k
a.p = k
a.s = n
a.v = f
a.z = i
m.v = f
i.v = f
i.w = a
i.y = k
i.t = j
d.v = e
d.t = n
d.z = k
k.r = j
e.v = d
e.y = i
e.q = i
e.z = a
e.w = m
e.o = j
e.p = k
n.r = b
n.y = b
n.s = k
n.v = e
n.x = e
n.w = i
j.r = k
j.o = k
j.t = k
j.p = k
j.s = f
j.v = n
j.z = i
f.r = b
f.y = b
f.s = k
f.v = e
f.x = e
f.w = i
assert f.y.y.v.v.v.v.q.v.r.z.txt == "j"