class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: B = None
        self.r: I = None
        self.o: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: J = None
        self.v: F = None
        self.q: B = None
        self.t: D = None
        self.r: J = None
        self.p: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: J = None
        self.z: F = None
        self.r: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: J = None
        self.z: B = None
        self.v: C = None
        self.o: D = None
        self.r: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: J = None
        self.v: F = None
        self.q: B = None
        self.t: D = None
        self.r: J = None
        self.p: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: J = None
        self.z: F = None
        self.r: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: J = None
        self.z: B = None
        self.v: C = None
        self.o: D = None
        self.r: D = None
        self.txt = txt

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

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

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