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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: E = None
        self.p: E = None
        self.w: D = None
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.x: D = None
        self.w: B = None
        self.v: D = None
        self.t: G = None
        self.r: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: C = None
        self.q: D = None
        self.p: F = None
        self.z: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: D = None
        self.o: E = None
        self.u: A = None
        self.v: A = None
        self.z: B = None
        self.x: B = None
        self.y: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: E = None
        self.p: E = None
        self.w: D = None
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.x: D = None
        self.w: B = None
        self.v: D = None
        self.t: G = None
        self.r: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: C = None
        self.q: D = None
        self.p: F = None
        self.z: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: D = None
        self.o: E = None
        self.u: A = None
        self.v: A = None
        self.z: B = None
        self.x: B = None
        self.y: F = None
        self.txt = txt

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

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