class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: J = None
        self.z: E = None
        self.r: A = None
        self.t: B = None
        self.x: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: H = None
        self.y: A = None
        self.r: F = None
        self.v: B = None
        self.q: B = None
        self.p: H = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: J = None
        self.q: D = None
        self.t: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: F = None
        self.y: C = None
        self.v: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: C = None
        self.o: G = None
        self.z: G = None
        self.v: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: J = None
        self.z: E = None
        self.r: A = None
        self.t: B = None
        self.x: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: H = None
        self.y: A = None
        self.r: F = None
        self.v: B = None
        self.q: B = None
        self.p: H = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: J = None
        self.q: D = None
        self.t: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: F = None
        self.y: C = None
        self.v: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: C = None
        self.o: G = None
        self.z: G = None
        self.v: F = None
        self.txt = txt

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

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