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

class B:
    def __init__(self, txt: str):
        self.v: J = None
        self.x: E = None
        self.y: G = None
        self.o: E = None
        self.s: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: I = None
        self.y: H = None
        self.x: J = None
        self.v: G = None
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: D = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: G = None
        self.x: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: J = None
        self.x: E = None
        self.y: G = None
        self.o: E = None
        self.s: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: I = None
        self.y: H = None
        self.x: J = None
        self.v: G = None
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: D = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: G = None
        self.x: H = None
        self.txt = txt

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

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