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

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: A = None
        self.x: H = None
        self.u: D = None
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: E = None
        self.o: I = None
        self.x: E = None
        self.w: F = None
        self.u: G = None
        self.v: I = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: D = None
        self.y: I = None
        self.u: C = None
        self.t: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

g = A("g")
i = B("i")
e = C("e")
m = D("m")
n = E("n")
d = F("d")
a = G("a")
f = H("f")
b = I("b")

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

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: A = None
        self.x: H = None
        self.u: D = None
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: E = None
        self.o: I = None
        self.x: E = None
        self.w: F = None
        self.u: G = None
        self.v: I = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: D = None
        self.y: I = None
        self.u: C = None
        self.t: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

g = A("g")
i = B("i")
e = C("e")
m = D("m")
n = E("n")
d = F("d")
a = G("a")
f = H("f")
b = I("b")

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