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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: D = None
        self.w: F = None
        self.v: C = None
        self.r: D = None
        self.u: I = None
        self.o: C = None
        self.s: E = None
        self.z: D = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.t: C = None
        self.p: A = None
        self.v: A = None
        self.z: C = None
        self.y: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: E = None
        self.t: E = None
        self.r: A = None
        self.z: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: D = None
        self.w: F = None
        self.v: C = None
        self.r: D = None
        self.u: I = None
        self.o: C = None
        self.s: E = None
        self.z: D = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.t: C = None
        self.p: A = None
        self.v: A = None
        self.z: C = None
        self.y: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: E = None
        self.t: E = None
        self.r: A = None
        self.z: C = None
        self.txt = txt

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

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