class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: E = None
        self.z: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: I = None
        self.w: E = None
        self.o: E = None
        self.z: G = None
        self.x: G = None
        self.u: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: A = None
        self.v: A = None
        self.y: I = None
        self.u: F = None
        self.w: F = None
        self.t: F = None
        self.s: C = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: H = None
        self.t: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: I = None
        self.w: E = None
        self.o: E = None
        self.z: G = None
        self.x: G = None
        self.u: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: A = None
        self.v: A = None
        self.y: I = None
        self.u: F = None
        self.w: F = None
        self.t: F = None
        self.s: C = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: H = None
        self.t: E = None
        self.txt = txt

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

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