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

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: F = None
        self.s: I = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: F = None
        self.s: I = None
        self.txt = txt

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

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

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