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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: H = None
        self.z: E = None
        self.q: B = None
        self.x: E = None
        self.r: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: A = None
        self.w: F = None
        self.q: B = None
        self.s: A = None
        self.z: H = None
        self.txt = txt

c = A("c")
n = B("n")
j = C("j")
a = D("a")
i = E("i")
k = F("k")
f = G("f")
g = H("g")
d = I("d")

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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: H = None
        self.z: E = None
        self.q: B = None
        self.x: E = None
        self.r: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: A = None
        self.w: F = None
        self.q: B = None
        self.s: A = None
        self.z: H = None
        self.txt = txt

c = A("c")
n = B("n")
j = C("j")
a = D("a")
i = E("i")
k = F("k")
f = G("f")
g = H("g")
d = I("d")

c.p = g
n.z = k
n.o = a
n.s = g
n.r = g
n.w = j
n.p = f
n.q = f
n.t = i
n.y = d
j.r = c
j.z = g
a.t = k
a.u = k
a.p = n
a.o = f
a.x = d
a.s = j
i.u = k
i.t = k
i.z = k
i.o = d
i.s = a
i.q = f
i.w = g
k.u = i
k.z = i
k.x = i
k.p = g
k.q = n
k.r = a
f.u = n
g.y = j
g.t = c
g.s = a
g.p = k
g.v = i
d.v = c
d.p = c
d.s = c
d.w = k
d.q = n
d.z = g
assert a.x.q.r.t.p.y.r.txt == "c"