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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

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