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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: C = None
        self.w: H = None
        self.t: A = None
        self.u: D = None
        self.o: F = None
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: H = None
        self.y: G = None
        self.w: E = None
        self.t: E = None
        self.s: D = None
        self.z: G = None
        self.o: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.u: F = None
        self.s: E = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: E = None
        self.q: C = None
        self.t: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: C = None
        self.w: H = None
        self.t: A = None
        self.u: D = None
        self.o: F = None
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: H = None
        self.y: G = None
        self.w: E = None
        self.t: E = None
        self.s: D = None
        self.z: G = None
        self.o: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.u: F = None
        self.s: E = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: E = None
        self.q: C = None
        self.t: D = None
        self.txt = txt

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

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