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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: C = None
        self.q: A = None
        self.o: G = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: C = None
        self.q: A = None
        self.o: G = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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