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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: F = None
        self.y: J = None
        self.x: B = None
        self.o: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: B = None
        self.q: G = None
        self.p: F = None
        self.x: A = None
        self.t: G = None
        self.u: B = None
        self.v: B = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: J = None
        self.q: I = None
        self.y: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: G = None
        self.u: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: G = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: F = None
        self.y: J = None
        self.x: B = None
        self.o: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: B = None
        self.q: G = None
        self.p: F = None
        self.x: A = None
        self.t: G = None
        self.u: B = None
        self.v: B = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: J = None
        self.q: I = None
        self.y: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: G = None
        self.u: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: G = None
        self.txt = txt

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

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

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