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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: G = None
        self.y: I = None
        self.t: D = None
        self.x: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: J = None
        self.p: D = None
        self.r: B = None
        self.s: J = None
        self.txt = txt

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

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

l.p = h
l.q = k
l.r = i
l.y = i
l.w = c
l.t = b
l.x = f
l.u = n
b.p = j
b.x = j
b.o = n
b.y = k
b.t = h
a.s = n
h.p = i
c.r = f
j.q = i
j.p = b
j.x = n
j.s = n
j.w = h
j.y = l
j.z = k
n.s = h
f.w = c
f.p = l
f.z = l
f.v = a
f.q = a
f.y = j
f.o = k
f.u = k
k.t = b
k.r = b
k.y = i
k.s = i
k.p = h
i.p = f
i.v = c
i.t = c
i.y = k
i.u = h
assert i.y.s.t.r.v.s.s.p.t.r.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: I = None
        self.r: J = None
        self.w: E = None
        self.t: B = None
        self.x: H = None
        self.y: J = None
        self.u: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: G = None
        self.y: I = None
        self.t: D = None
        self.x: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: J = None
        self.p: D = None
        self.r: B = None
        self.s: J = None
        self.txt = txt

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

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

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