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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: G = None
        self.r: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: G = None
        self.q: H = None
        self.u: I = None
        self.w: B = None
        self.s: G = None
        self.t: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: C = None
        self.o: C = None
        self.s: A = None
        self.x: C = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: G = None
        self.r: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: G = None
        self.q: H = None
        self.u: I = None
        self.w: B = None
        self.s: G = None
        self.t: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: C = None
        self.o: C = None
        self.s: A = None
        self.x: C = None
        self.txt = txt

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

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

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

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

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