class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: G = None
        self.z: B = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: H = None
        self.t: A = None
        self.z: H = None
        self.s: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: G = None
        self.x: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

k = A("k")
m = B("m")
e = C("e")
b = D("b")
c = E("c")
n = F("n")
j = G("j")
g = H("g")
d = E("d")

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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: H = None
        self.t: A = None
        self.z: H = None
        self.s: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: G = None
        self.x: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

k = A("k")
m = B("m")
e = C("e")
b = D("b")
c = E("c")
n = F("n")
j = G("j")
g = H("g")
d = E("d")

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