class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.y: C = None
        self.r: B = None
        self.s: C = None
        self.p: H = None
        self.z: A = None
        self.x: C = None
        self.q: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.s: C = None
        self.x: H = None
        self.r: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: F = None
        self.v: C = None
        self.s: B = None
        self.y: E = None
        self.w: G = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.y: C = None
        self.r: B = None
        self.s: C = None
        self.p: H = None
        self.z: A = None
        self.x: C = None
        self.q: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.s: C = None
        self.x: H = None
        self.r: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: F = None
        self.v: C = None
        self.s: B = None
        self.y: E = None
        self.w: G = None
        self.txt = txt

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

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