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

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

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

class D:
    def __init__(self, txt: str):
        self.u: I = None
        self.y: A = None
        self.z: F = None
        self.r: A = None
        self.t: B = None
        self.w: B = None
        self.x: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: H = None
        self.z: D = None
        self.y: E = None
        self.q: A = None
        self.s: B = None
        self.r: F = None
        self.t: D = None
        self.u: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: E = None
        self.v: F = None
        self.w: B = None
        self.t: D = None
        self.p: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: A = None
        self.w: B = None
        self.o: D = None
        self.z: G = None
        self.p: G = None
        self.y: F = None
        self.t: G = None
        self.x: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: I = None
        self.y: A = None
        self.z: F = None
        self.r: A = None
        self.t: B = None
        self.w: B = None
        self.x: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: H = None
        self.z: D = None
        self.y: E = None
        self.q: A = None
        self.s: B = None
        self.r: F = None
        self.t: D = None
        self.u: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: E = None
        self.v: F = None
        self.w: B = None
        self.t: D = None
        self.p: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: A = None
        self.w: B = None
        self.o: D = None
        self.z: G = None
        self.p: G = None
        self.y: F = None
        self.t: G = None
        self.x: D = None
        self.txt = txt

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

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