class A:
    def __init__(self, txt: str):
        self.u: J = None
        self.y: C = None
        self.x: E = None
        self.w: E = None
        self.z: C = None
        self.t: E = None
        self.p: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.w: A = None
        self.u: D = None
        self.t: G = None
        self.v: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.u: I = None
        self.p: I = None
        self.w: E = None
        self.q: I = None
        self.z: H = None
        self.x: H = None
        self.v: F = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.w: A = None
        self.u: D = None
        self.t: G = None
        self.v: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.u: I = None
        self.p: I = None
        self.w: E = None
        self.q: I = None
        self.z: H = None
        self.x: H = None
        self.v: F = None
        self.txt = txt

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

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

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

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

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

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

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

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

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