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

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: B = None
        self.w: B = None
        self.x: H = None
        self.o: I = None
        self.p: H = None
        self.t: H = None
        self.u: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: F = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: D = None
        self.o: B = None
        self.p: C = None
        self.txt = txt

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

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

n = A("n")
c = B("c")
m = C("m")
e = D("e")
b = E("b")
a = F("a")
f = G("f")
i = H("i")
j = I("j")

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

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: B = None
        self.w: B = None
        self.x: H = None
        self.o: I = None
        self.p: H = None
        self.t: H = None
        self.u: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: F = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: D = None
        self.o: B = None
        self.p: C = None
        self.txt = txt

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

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

n = A("n")
c = B("c")
m = C("m")
e = D("e")
b = E("b")
a = F("a")
f = G("f")
i = H("i")
j = I("j")

n.w = f
n.p = f
n.y = f
n.o = j
n.x = b
n.q = a
n.r = c
n.s = i
c.z = j
m.s = b
m.y = c
m.w = c
m.x = i
m.p = i
m.t = i
m.u = i
m.o = j
e.p = b
e.o = a
e.z = c
b.v = e
b.t = j
a.p = c
a.t = j
a.x = f
a.z = n
a.u = m
f.w = m
f.p = m
f.y = e
f.o = c
i.t = e
i.w = n
i.u = n
i.x = n
i.y = j
i.q = j
i.r = b
i.z = m
i.v = f
j.q = e
assert i.z.y.z.q.o.x.w.txt == "m"