class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: I = None
        self.p: G = None
        self.q: H = None
        self.y: C = None
        self.u: I = None
        self.w: A = None
        self.r: G = None
        self.z: D = None
        self.x: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: H = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.o: A = None
        self.q: C = None
        self.w: D = None
        self.u: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: B = None
        self.v: C = None
        self.u: I = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: I = None
        self.p: G = None
        self.q: H = None
        self.y: C = None
        self.u: I = None
        self.w: A = None
        self.r: G = None
        self.z: D = None
        self.x: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: H = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.o: A = None
        self.q: C = None
        self.w: D = None
        self.u: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: B = None
        self.v: C = None
        self.u: I = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: B = None
        self.txt = txt

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

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