class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: D = None
        self.x: A = None
        self.t: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.z: H = None
        self.x: A = None
        self.r: G = None
        self.y: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: H = None
        self.o: H = None
        self.y: E = None
        self.w: D = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: D = None
        self.x: A = None
        self.t: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.z: H = None
        self.x: A = None
        self.r: G = None
        self.y: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: H = None
        self.o: H = None
        self.y: E = None
        self.w: D = None
        self.txt = txt

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

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

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

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