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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: J = None
        self.t: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: J = None
        self.r: F = None
        self.u: H = None
        self.s: H = None
        self.txt = txt

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

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: J = None
        self.t: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: J = None
        self.r: F = None
        self.u: H = None
        self.s: H = None
        self.txt = txt

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

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

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