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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: J = None
        self.z: I = None
        self.u: B = None
        self.w: H = None
        self.x: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: I = None
        self.s: F = None
        self.u: J = None
        self.v: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: C = None
        self.o: I = None
        self.t: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: J = None
        self.x: F = None
        self.r: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: I = None
        self.u: B = None
        self.r: B = None
        self.x: E = None
        self.z: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.y: F = None
        self.u: E = None
        self.q: C = None
        self.r: B = None
        self.s: I = None
        self.t: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: J = None
        self.z: I = None
        self.u: B = None
        self.w: H = None
        self.x: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: I = None
        self.s: F = None
        self.u: J = None
        self.v: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: C = None
        self.o: I = None
        self.t: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: J = None
        self.x: F = None
        self.r: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: I = None
        self.u: B = None
        self.r: B = None
        self.x: E = None
        self.z: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.y: F = None
        self.u: E = None
        self.q: C = None
        self.r: B = None
        self.s: I = None
        self.t: H = None
        self.txt = txt

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

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