class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: C = None
        self.z: H = None
        self.t: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: I = None
        self.s: D = None
        self.u: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: J = None
        self.z: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: F = None
        self.r: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.q: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: D = None
        self.t: J = None
        self.o: B = None
        self.z: B = None
        self.q: I = None
        self.w: E = None
        self.p: F = None
        self.s: F = None
        self.u: B = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.o: H = None
        self.s: I = None
        self.v: E = None
        self.w: D = None
        self.x: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: I = None
        self.s: D = None
        self.u: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: J = None
        self.z: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: F = None
        self.r: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.q: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: D = None
        self.t: J = None
        self.o: B = None
        self.z: B = None
        self.q: I = None
        self.w: E = None
        self.p: F = None
        self.s: F = None
        self.u: B = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.o: H = None
        self.s: I = None
        self.v: E = None
        self.w: D = None
        self.x: E = None
        self.txt = txt

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

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