class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: G = None
        self.v: H = None
        self.y: J = None
        self.u: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.o: H = None
        self.p: G = None
        self.v: G = None
        self.r: G = None
        self.y: I = None
        self.u: B = None
        self.w: B = None
        self.z: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: J = None
        self.z: H = None
        self.p: J = None
        self.s: I = None
        self.u: J = None
        self.t: I = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: A = None
        self.o: H = None
        self.u: C = None
        self.txt = txt

m = A("m")
e = B("e")
g = C("g")
k = D("k")
h = E("h")
d = F("d")
l = G("l")
b = H("b")
f = I("f")
n = J("n")

m.x = d
m.w = l
m.v = b
m.y = n
m.u = n
e.u = b
e.o = m
g.v = k
g.p = e
k.q = g
h.t = b
h.o = b
h.p = l
h.v = l
h.r = l
h.y = f
h.u = e
h.w = e
h.z = m
d.y = k
d.q = k
l.o = n
l.p = n
l.u = n
l.z = b
l.s = f
l.t = f
b.u = d
b.w = l
b.z = l
f.u = g
f.p = l
n.x = m
n.z = m
n.o = b
n.u = g
assert m.w.z.w.z.w.s.u.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: G = None
        self.v: H = None
        self.y: J = None
        self.u: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.o: H = None
        self.p: G = None
        self.v: G = None
        self.r: G = None
        self.y: I = None
        self.u: B = None
        self.w: B = None
        self.z: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: J = None
        self.z: H = None
        self.p: J = None
        self.s: I = None
        self.u: J = None
        self.t: I = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: A = None
        self.o: H = None
        self.u: C = None
        self.txt = txt

m = A("m")
e = B("e")
g = C("g")
k = D("k")
h = E("h")
d = F("d")
l = G("l")
b = H("b")
f = I("f")
n = J("n")

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