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

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.u: G = None
        self.q: G = None
        self.x: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: G = None
        self.y: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.y: F = None
        self.o: B = None
        self.r: B = None
        self.p: E = None
        self.txt = txt

d = A("d")
c = B("c")
l = C("l")
g = D("g")
b = E("b")
n = F("n")
i = G("i")
e = H("e")
h = G("h")
f = F("f")

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

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.u: G = None
        self.q: G = None
        self.x: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: G = None
        self.y: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.y: F = None
        self.o: B = None
        self.r: B = None
        self.p: E = None
        self.txt = txt

d = A("d")
c = B("c")
l = C("l")
g = D("g")
b = E("b")
n = F("n")
i = G("i")
e = H("e")
h = G("h")
f = F("f")

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