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

class B:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: C = None
        self.s: A = None
        self.v: C = None
        self.y: A = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.r: G = None
        self.w: F = None
        self.u: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: C = None
        self.s: A = None
        self.v: C = None
        self.y: A = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.r: G = None
        self.w: F = None
        self.u: H = None
        self.txt = txt

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

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