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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: F = None
        self.w: B = None
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: A = None
        self.r: D = None
        self.u: G = None
        self.p: H = None
        self.q: B = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: E = None
        self.x: C = None
        self.s: G = None
        self.t: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: E = None
        self.s: F = None
        self.y: E = None
        self.z: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: B = None
        self.r: A = None
        self.u: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: F = None
        self.w: B = None
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: A = None
        self.r: D = None
        self.u: G = None
        self.p: H = None
        self.q: B = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: E = None
        self.x: C = None
        self.s: G = None
        self.t: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: E = None
        self.s: F = None
        self.y: E = None
        self.z: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: B = None
        self.r: A = None
        self.u: A = None
        self.txt = txt

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

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