class A:
    def __init__(self, txt: str):
        self.q: I = None
        self.r: B = None
        self.w: E = None
        self.p: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.t: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: J = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: I = None
        self.v: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: C = None
        self.t: D = None
        self.z: D = None
        self.w: G = None
        self.o: D = None
        self.x: G = None
        self.s: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.t: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: J = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: I = None
        self.v: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: C = None
        self.t: D = None
        self.z: D = None
        self.w: G = None
        self.o: D = None
        self.x: G = None
        self.s: C = None
        self.txt = txt

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

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

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