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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: D = None
        self.y: C = None
        self.r: C = None
        self.q: A = None
        self.s: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: D = None
        self.t: D = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: B = None
        self.s: H = None
        self.r: E = None
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: I = None
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.q: C = None
        self.z: H = None
        self.o: I = None
        self.s: E = None
        self.v: E = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: J = None
        self.u: E = None
        self.w: B = None
        self.y: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: J = None
        self.x: I = None
        self.y: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: J = None
        self.z: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: A = None
        self.t: H = None
        self.z: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: D = None
        self.y: C = None
        self.r: C = None
        self.q: A = None
        self.s: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: D = None
        self.t: D = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: B = None
        self.s: H = None
        self.r: E = None
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: I = None
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.q: C = None
        self.z: H = None
        self.o: I = None
        self.s: E = None
        self.v: E = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: J = None
        self.u: E = None
        self.w: B = None
        self.y: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: J = None
        self.x: I = None
        self.y: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: J = None
        self.z: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: A = None
        self.t: H = None
        self.z: H = None
        self.txt = txt

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

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