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

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

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.y: H = None
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: A = None
        self.u: A = None
        self.x: G = None
        self.t: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: C = None
        self.s: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: C = None
        self.s: A = None
        self.p: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: E = None
        self.o: A = None
        self.q: F = None
        self.x: E = None
        self.t: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.y: H = None
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: A = None
        self.u: A = None
        self.x: G = None
        self.t: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: C = None
        self.s: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: C = None
        self.s: A = None
        self.p: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: E = None
        self.o: A = None
        self.q: F = None
        self.x: E = None
        self.t: G = None
        self.txt = txt

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

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