class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: G = None
        self.r: D = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: I = None
        self.p: A = None
        self.z: G = None
        self.u: J = None
        self.s: G = None
        self.t: G = None
        self.y: F = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: I = None
        self.u: I = None
        self.q: E = None
        self.r: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: C = None
        self.s: C = None
        self.p: E = None
        self.u: A = None
        self.r: G = None
        self.y: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: F = None
        self.t: F = None
        self.p: J = None
        self.q: H = None
        self.u: A = None
        self.v: H = None
        self.o: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: H = None
        self.q: A = None
        self.s: A = None
        self.u: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: I = None
        self.p: A = None
        self.z: G = None
        self.u: J = None
        self.s: G = None
        self.t: G = None
        self.y: F = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: I = None
        self.u: I = None
        self.q: E = None
        self.r: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: C = None
        self.s: C = None
        self.p: E = None
        self.u: A = None
        self.r: G = None
        self.y: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: F = None
        self.t: F = None
        self.p: J = None
        self.q: H = None
        self.u: A = None
        self.v: H = None
        self.o: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: H = None
        self.q: A = None
        self.s: A = None
        self.u: B = None
        self.txt = txt

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

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