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

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.r: C = None
        self.x: B = None
        self.q: G = None
        self.u: C = None
        self.w: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: I = None
        self.r: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: C = None
        self.t: E = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.r: C = None
        self.x: B = None
        self.q: G = None
        self.u: C = None
        self.w: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: I = None
        self.r: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: C = None
        self.t: E = None
        self.txt = txt

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

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

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

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