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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: H = None
        self.r: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: C = None
        self.o: C = None
        self.p: A = None
        self.z: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.w: G = None
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: E = None
        self.q: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: B = None
        self.p: B = None
        self.s: G = None
        self.o: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: H = None
        self.r: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: C = None
        self.o: C = None
        self.p: A = None
        self.z: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.w: G = None
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: E = None
        self.q: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: B = None
        self.p: B = None
        self.s: G = None
        self.o: A = None
        self.txt = txt

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

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