class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: G = None
        self.r: H = None
        self.u: I = None
        self.o: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: G = None
        self.o: F = None
        self.t: F = None
        self.y: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: I = None
        self.t: D = None
        self.p: A = None
        self.q: G = None
        self.w: I = None
        self.u: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: I = None
        self.u: A = None
        self.v: B = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: B = None
        self.p: G = None
        self.x: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: G = None
        self.o: F = None
        self.t: F = None
        self.y: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: I = None
        self.t: D = None
        self.p: A = None
        self.q: G = None
        self.w: I = None
        self.u: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: I = None
        self.u: A = None
        self.v: B = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: B = None
        self.p: G = None
        self.x: H = None
        self.txt = txt

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

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