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

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

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.u: G = None
        self.r: H = None
        self.t: A = None
        self.s: F = None
        self.y: H = None
        self.z: B = None
        self.txt = txt

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

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

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

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

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

i = A("i")
n = B("n")
j = C("j")
e = D("e")
g = E("g")
m = F("m")
b = G("b")
d = H("d")
h = E("h")

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

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

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.u: G = None
        self.r: H = None
        self.t: A = None
        self.s: F = None
        self.y: H = None
        self.z: B = None
        self.txt = txt

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

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

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

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

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

i = A("i")
n = B("n")
j = C("j")
e = D("e")
g = E("g")
m = F("m")
b = G("b")
d = H("d")
h = E("h")

i.y = g
i.r = g
i.w = n
i.q = n
i.v = e
i.z = d
i.o = b
n.r = m
n.o = m
n.q = e
n.w = e
n.y = j
n.p = b
n.v = d
j.v = d
j.r = d
j.y = d
j.u = b
j.t = i
j.s = m
j.z = n
e.r = j
e.v = j
e.t = b
e.q = n
e.w = n
e.s = m
g.v = e
m.t = n
m.o = n
m.r = h
m.w = i
m.q = i
m.y = b
b.r = i
b.p = n
b.t = e
b.z = j
b.q = m
d.p = m
d.u = n
d.r = j
h.v = e
assert m.q.o.q.q.txt == "i"