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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: D = None
        self.v: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: D = None
        self.o: F = None
        self.u: A = None
        self.y: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: D = None
        self.y: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: D = None
        self.v: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: D = None
        self.o: F = None
        self.u: A = None
        self.y: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: D = None
        self.y: C = None
        self.txt = txt

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

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