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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: C = None
        self.t: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: I = None
        self.q: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: I = None
        self.s: F = None
        self.z: B = None
        self.p: E = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.w: I = None
        self.txt = txt

f = A("f")
i = B("i")
e = C("e")
n = D("n")
l = E("l")
d = F("d")
h = G("h")
k = H("k")
g = I("g")
b = J("b")

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: C = None
        self.t: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: I = None
        self.q: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: I = None
        self.s: F = None
        self.z: B = None
        self.p: E = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.w: I = None
        self.txt = txt

f = A("f")
i = B("i")
e = C("e")
n = D("n")
l = E("l")
d = F("d")
h = G("h")
k = H("k")
g = I("g")
b = J("b")

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