class A:
    def __init__(self, txt: str):
        self.u: H = None
        self.s: H = None
        self.w: G = None
        self.o: I = None
        self.y: F = None
        self.p: H = None
        self.r: C = None
        self.q: J = None
        self.v: H = None
        self.txt = txt

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

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

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.w: J = None
        self.s: J = None
        self.z: C = None
        self.q: A = None
        self.x: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: H = None
        self.y: C = None
        self.o: I = None
        self.r: I = None
        self.w: E = None
        self.p: F = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.w: J = None
        self.s: J = None
        self.z: C = None
        self.q: A = None
        self.x: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: H = None
        self.y: C = None
        self.o: I = None
        self.r: I = None
        self.w: E = None
        self.p: F = None
        self.txt = txt

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

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