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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: D = None
        self.s: I = None
        self.p: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: G = None
        self.w: I = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: I = None
        self.s: G = None
        self.v: C = None
        self.w: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: H = None
        self.w: E = None
        self.p: H = None
        self.y: H = None
        self.s: E = None
        self.o: D = None
        self.u: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: E = None
        self.o: G = None
        self.t: B = None
        self.p: C = None
        self.x: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: C = None
        self.w: E = None
        self.q: A = None
        self.t: B = None
        self.p: C = None
        self.z: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: D = None
        self.s: I = None
        self.p: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: G = None
        self.w: I = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: I = None
        self.s: G = None
        self.v: C = None
        self.w: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: H = None
        self.w: E = None
        self.p: H = None
        self.y: H = None
        self.s: E = None
        self.o: D = None
        self.u: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: E = None
        self.o: G = None
        self.t: B = None
        self.p: C = None
        self.x: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: C = None
        self.w: E = None
        self.q: A = None
        self.t: B = None
        self.p: C = None
        self.z: D = None
        self.txt = txt

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

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