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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: I = None
        self.s: D = None
        self.w: G = None
        self.r: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: D = None
        self.o: D = None
        self.v: I = None
        self.z: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: B = None
        self.t: I = None
        self.s: H = None
        self.w: D = None
        self.z: B = None
        self.o: E = None
        self.v: H = None
        self.x: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: I = None
        self.w: I = None
        self.r: G = None
        self.t: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: F = None
        self.q: B = None
        self.t: A = None
        self.z: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: I = None
        self.s: D = None
        self.w: G = None
        self.r: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: D = None
        self.o: D = None
        self.v: I = None
        self.z: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: B = None
        self.t: I = None
        self.s: H = None
        self.w: D = None
        self.z: B = None
        self.o: E = None
        self.v: H = None
        self.x: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: I = None
        self.w: I = None
        self.r: G = None
        self.t: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: F = None
        self.q: B = None
        self.t: A = None
        self.z: B = None
        self.txt = txt

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

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