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

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

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: G = None
        self.p: B = None
        self.x: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: C = None
        self.o: D = None
        self.w: C = None
        self.y: D = None
        self.r: D = None
        self.z: G = None
        self.x: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: G = None
        self.p: B = None
        self.x: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: C = None
        self.o: D = None
        self.w: C = None
        self.y: D = None
        self.r: D = None
        self.z: G = None
        self.x: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: F = None
        self.txt = txt

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

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

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