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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: E = None
        self.q: E = None
        self.t: G = None
        self.o: E = None
        self.w: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: A = None
        self.v: C = None
        self.q: H = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: I = None
        self.y: E = None
        self.o: C = None
        self.s: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.q: H = None
        self.u: H = None
        self.p: G = None
        self.v: F = None
        self.s: H = None
        self.z: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: E = None
        self.q: E = None
        self.t: G = None
        self.o: E = None
        self.w: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: A = None
        self.v: C = None
        self.q: H = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: I = None
        self.y: E = None
        self.o: C = None
        self.s: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.q: H = None
        self.u: H = None
        self.p: G = None
        self.v: F = None
        self.s: H = None
        self.z: G = None
        self.txt = txt

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

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