class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: D = None
        self.o: D = None
        self.v: C = None
        self.x: E = None
        self.s: I = None
        self.z: G = None
        self.r: I = None
        self.w: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: I = None
        self.z: B = None
        self.r: C = None
        self.t: G = None
        self.y: B = None
        self.x: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.y: C = None
        self.txt = txt

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

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

a = A("a")
k = B("k")
f = C("f")
m = D("m")
l = E("l")
i = F("i")
n = G("n")
g = H("g")
j = I("j")

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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: I = None
        self.z: B = None
        self.r: C = None
        self.t: G = None
        self.y: B = None
        self.x: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.y: C = None
        self.txt = txt

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

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

a = A("a")
k = B("k")
f = C("f")
m = D("m")
l = E("l")
i = F("i")
n = G("n")
g = H("g")
j = I("j")

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