class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: B = None
        self.v: H = None
        self.y: C = None
        self.z: H = None
        self.o: A = None
        self.u: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: A = None
        self.u: E = None
        self.z: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: F = None
        self.u: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: A = None
        self.r: E = None
        self.w: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: A = None
        self.u: E = None
        self.z: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: F = None
        self.u: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: A = None
        self.r: E = None
        self.w: H = None
        self.txt = txt

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

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

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