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

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

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

class D:
    def __init__(self, txt: str):
        self.s: I = None
        self.o: E = None
        self.t: F = None
        self.q: C = None
        self.u: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.r: A = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: B = None
        self.u: I = None
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: J = None
        self.u: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: F = None
        self.y: C = None
        self.t: E = None
        self.v: F = None
        self.u: E = None
        self.s: D = None
        self.p: E = None
        self.r: I = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: I = None
        self.o: E = None
        self.t: F = None
        self.q: C = None
        self.u: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.r: A = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: B = None
        self.u: I = None
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: J = None
        self.u: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: F = None
        self.y: C = None
        self.t: E = None
        self.v: F = None
        self.u: E = None
        self.s: D = None
        self.p: E = None
        self.r: I = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

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