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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: D = None
        self.o: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: G = None
        self.q: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: H = None
        self.t: I = None
        self.v: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.z: G = None
        self.w: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

n.v = g
n.q = m
n.p = k
n.x = k
n.z = j
n.r = d
g.w = m
g.z = k
g.u = n
g.p = d
m.s = a
m.x = a
m.o = k
a.w = m
a.z = f
a.q = d
j.w = n
j.s = e
j.v = e
j.t = k
d.r = f
d.z = f
d.w = a
f.v = n
f.t = n
f.p = e
f.r = d
f.q = j
f.y = j
f.z = k
f.x = k
f.s = k
e.r = n
e.w = k
k.p = m
assert j.w.r.w.q.z.p.r.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: C = None
        self.p: I = None
        self.z: E = None
        self.x: I = None
        self.r: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: D = None
        self.o: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: G = None
        self.q: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: H = None
        self.t: I = None
        self.v: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.z: G = None
        self.w: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

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