class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.z: C = None
        self.o: G = None
        self.y: H = None
        self.q: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: F = None
        self.txt = txt

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

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: F = None
        self.txt = txt

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

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

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

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

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

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

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