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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.p: H = None
        self.z: C = None
        self.s: G = None
        self.q: C = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.x: A = None
        self.z: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: A = None
        self.v: A = None
        self.r: G = None
        self.o: A = None
        self.z: A = None
        self.y: D = None
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: D = None
        self.s: E = None
        self.v: B = None
        self.q: D = None
        self.x: B = None
        self.u: C = None
        self.z: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.p: H = None
        self.z: C = None
        self.s: G = None
        self.q: C = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.x: A = None
        self.z: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: A = None
        self.v: A = None
        self.r: G = None
        self.o: A = None
        self.z: A = None
        self.y: D = None
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: D = None
        self.s: E = None
        self.v: B = None
        self.q: D = None
        self.x: B = None
        self.u: C = None
        self.z: E = None
        self.txt = txt

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

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