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

class B:
    def __init__(self, txt: str):
        self.q: J = None
        self.r: E = None
        self.p: D = None
        self.t: D = None
        self.w: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: H = None
        self.u: E = None
        self.y: F = None
        self.w: J = None
        self.r: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: H = None
        self.q: E = None
        self.p: C = None
        self.t: A = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: G = None
        self.p: H = None
        self.r: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: J = None
        self.r: E = None
        self.p: D = None
        self.t: D = None
        self.w: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: H = None
        self.u: E = None
        self.y: F = None
        self.w: J = None
        self.r: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: H = None
        self.q: E = None
        self.p: C = None
        self.t: A = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: G = None
        self.p: H = None
        self.r: B = None
        self.txt = txt

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

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